1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Remove two unused fields from the Parse structure. The TCL interface now

removes leading whitespace from SQL statements before parsing them. (CVS 6846)

FossilOrigin-Name: 983cb6924b8a7d3057718b9228c0cb2fbe7f0dc4
This commit is contained in:
drh
2009-07-03 22:54:36 +00:00
parent 1adecdf814
commit e7f3f3eec1
5 changed files with 14 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
C Remove\sunused\scode\s(that\swas\scommented\sout)\sfrom\sprepare.c.\s\sRemove\san\nincorrect\sNEVER()\smacro.\s\sFix\sthe\scomment\son\sschemaIsValid()\sto\scorrectly\ndescribe\sits\sreturn\sbehavior.\s(CVS\s6845) C Remove\stwo\sunused\sfields\sfrom\sthe\sParse\sstructure.\s\sThe\sTCL\sinterface\snow\nremoves\sleading\swhitespace\sfrom\sSQL\sstatements\sbefore\sparsing\sthem.\s(CVS\s6846)
D 2009-07-03T19:19:50 D 2009-07-03T22:54:37
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -163,11 +163,11 @@ F src/select.c 71748b8e244112cf73df9446c4246c192276c30d
F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb
F src/sqlite.h.in ccc67f14d5661240d05eadb8ab308aa637b0630c F src/sqlite.h.in ccc67f14d5661240d05eadb8ab308aa637b0630c
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h 8460c998fff4834f875c32233a2d63004163cee9 F src/sqliteInt.h 336d10317b991fda9019d8dcc6f67e936fc55ae9
F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76 F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
F src/tclsqlite.c d3195e0738c101a155404ecdb1cd9532a2fd34f2 F src/tclsqlite.c e18e5013dc6bca9f25e6022fbe17ba3ccb821f95
F src/test1.c c8f9358879876660b721369f576bf6e4ac5b9210 F src/test1.c c8f9358879876660b721369f576bf6e4ac5b9210
F src/test2.c d73e4a490349245fb196b990b80684513e0ceaee F src/test2.c d73e4a490349245fb196b990b80684513e0ceaee
F src/test3.c a06da9e41583fe8e4eb8c4dea323bb72bdbaaa1e F src/test3.c a06da9e41583fe8e4eb8c4dea323bb72bdbaaa1e
@@ -198,7 +198,7 @@ F src/test_server.c f0a403b5f699c09bd2b1236b6f69830fd6221f6b
F src/test_tclvar.c 9e42fa59d3d2f064b7ab8628e7ab2dc8a9fe93d4 F src/test_tclvar.c 9e42fa59d3d2f064b7ab8628e7ab2dc8a9fe93d4
F src/test_thread.c b8a1ab7ca1a632f18e8a361880d5d65eeea08eac F src/test_thread.c b8a1ab7ca1a632f18e8a361880d5d65eeea08eac
F src/test_wsd.c 3ae5101de6cbfda2720152ab659ea84079719241 F src/test_wsd.c 3ae5101de6cbfda2720152ab659ea84079719241
F src/tokenize.c eadd396fa81e8031d4b4a65eefd661e9c675167f F src/tokenize.c af8a56e6a50c5042fc305bfa796275e9bf26ff2b
F src/trigger.c c07c5157c58fcdb704f65d5f5e4775276e45bb8b F src/trigger.c c07c5157c58fcdb704f65d5f5e4775276e45bb8b
F src/update.c a1bbe774bce495d62dce3df3f42a5f04c1de173a F src/update.c a1bbe774bce495d62dce3df3f42a5f04c1de173a
F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
P e9849292ab741f4c86203b2629dbe116f9b527c8 P 90deb65835febc908f21bca89ef497d1048afe0a
R 587ce2327c9513e978edc633162d7539 R 430f40c3b49dbd6d5c53832ea096a991
U drh U drh
Z bd714fe85ba5b195da90521b32b83698 Z 301b92e83560c1a5b1bd3c9e33371bc8

View File

@@ -1 +1 @@
90deb65835febc908f21bca89ef497d1048afe0a 983cb6924b8a7d3057718b9228c0cb2fbe7f0dc4

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.891 2009/07/03 15:37:28 drh Exp $ ** @(#) $Id: sqliteInt.h,v 1.892 2009/07/03 22:54:37 drh Exp $
*/ */
#ifndef _SQLITEINT_H_ #ifndef _SQLITEINT_H_
#define _SQLITEINT_H_ #define _SQLITEINT_H_
@@ -2020,10 +2020,8 @@ struct Parse {
int nAliasAlloc; /* Number of allocated slots for aAlias[] */ int nAliasAlloc; /* Number of allocated slots for aAlias[] */
int *aAlias; /* Register used to hold aliased result */ int *aAlias; /* Register used to hold aliased result */
u8 explain; /* True if the EXPLAIN flag is found on the query */ u8 explain; /* True if the EXPLAIN flag is found on the query */
Token sErrToken; /* The token at which the error occurred */
Token sNameToken; /* Token with unqualified schema object name */ Token sNameToken; /* Token with unqualified schema object name */
Token sLastToken; /* The last token parsed */ Token sLastToken; /* The last token parsed */
const char *zSql; /* All SQL text */
const char *zTail; /* All SQL text past the last semicolon parsed */ const char *zTail; /* All SQL text past the last semicolon parsed */
Table *pNewTable; /* A table being constructed by CREATE TABLE */ Table *pNewTable; /* A table being constructed by CREATE TABLE */
Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */

View File

@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and ** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite. ** compile the whole thing to build a TCL-enabled version of SQLite.
** **
** $Id: tclsqlite.c,v 1.241 2009/03/27 12:44:35 drh Exp $ ** $Id: tclsqlite.c,v 1.242 2009/07/03 22:54:37 drh Exp $
*/ */
#include "tcl.h" #include "tcl.h"
#include <errno.h> #include <errno.h>
@@ -1674,6 +1674,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** which matches the next sequence of SQL. ** which matches the next sequence of SQL.
*/ */
pStmt = 0; pStmt = 0;
while( isspace(zSql[0]) ){ zSql++; }
len = strlen30(zSql); len = strlen30(zSql);
for(pPreStmt = pDb->stmtList; pPreStmt; pPreStmt=pPreStmt->pNext){ for(pPreStmt = pDb->stmtList; pPreStmt; pPreStmt=pPreStmt->pNext){
int n = pPreStmt->nSql; int n = pPreStmt->nSql;

View File

@@ -15,7 +15,7 @@
** individual tokens and sends those tokens one-by-one over to the ** individual tokens and sends those tokens one-by-one over to the
** parser for analysis. ** parser for analysis.
** **
** $Id: tokenize.c,v 1.162 2009/06/23 20:28:54 drh Exp $ ** $Id: tokenize.c,v 1.163 2009/07/03 22:54:37 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <stdlib.h> #include <stdlib.h>
@@ -410,7 +410,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
db->u1.isInterrupted = 0; db->u1.isInterrupted = 0;
} }
pParse->rc = SQLITE_OK; pParse->rc = SQLITE_OK;
pParse->zTail = pParse->zSql = zSql; pParse->zTail = zSql;
i = 0; i = 0;
assert( pzErrMsg!=0 ); assert( pzErrMsg!=0 );
pEngine = sqlite3ParserAlloc((void*(*)(size_t))sqlite3Malloc); pEngine = sqlite3ParserAlloc((void*(*)(size_t))sqlite3Malloc);