-C Increase\stest\scoverage\sof\snew\ssavepoint\scode.\s(CVS\s6040)
-D 2008-12-18T18:31:39
+C Fix\sthe\sOracle\sand\sMS-Sql\scommand-line\sterminator\slogic\sin\sthe\sCLI.\nTicket\s#3544.\s(CVS\s6041)
+D 2008-12-18T22:25:14
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in f7e4c81c347b04f7b0f1c1b081a168645d7b8af7
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/resolve.c 18dc9f0df1d60048e012ce6632251063e0dd356a
F src/rowset.c 2256fa4a928f750e2f3d6fc733523034beceb1d6
F src/select.c a4316c5e8a417687e159b3d3ae689363d1dec5df
-F src/shell.c 60638e2fdfe97f1eb9c18caf87d3744d8269d012
+F src/shell.c 65d19f8996a160f288087e31810f24025439c62a
F src/sqlite.h.in 065a828e299960316aa34f05b9f0f10f33afe4c8
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h d7f8532c81038b1133d55c68f96afaf93ffb9138
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 98a53d91f6c0c2692d3b56687fdaba8eeab0959d
-R 62d8e49e78bd385c3c1bd94a9682f5e4
-U danielk1977
-Z 22b6c1944a6bc7d00fc6f077bed85661
+P d915718d0b346982d686d131a159b67e28fc02a8
+R 5310eca4075c4ebf704f216d6b1c02dc
+U drh
+Z 24e69d5ad73c2571e030bbcae477397b
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
-** $Id: shell.c,v 1.195 2008/12/11 02:58:27 shane Exp $
+** $Id: shell.c,v 1.196 2008/12/18 22:25:14 drh Exp $
*/
#if defined(_WIN32) || defined(WIN32)
/* This needs to come before any includes for MSVC compiler */
*/
static int _is_command_terminator(const char *zLine){
while( isspace(*(unsigned char*)zLine) ){ zLine++; };
- if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ) return 1; /* Oracle */
+ if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){
+ return 1; /* Oracle */
+ }
if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o'
&& _all_whitespace(&zLine[2]) ){
return 1; /* SQL Server */
return 0;
}
+/*
+** Return true if zSql is a complete SQL statement. Return false if it
+** ends in the middle of a string literal or C-style comment.
+*/
+static int _is_complete(char *zSql, int nSql){
+ int rc;
+ if( zSql==0 ) return 1;
+ zSql[nSql] = ';';
+ zSql[nSql+1] = 0;
+ rc = sqlite3_complete(zSql);
+ zSql[nSql] = 0;
+ return rc;
+}
+
/*
** Read input from *in and process it. If *in==0 then input
** is interactive - the user is typing it it. Otherwise, input
}
continue;
}
- if( _is_command_terminator(zLine) && sqlite3_complete(zSql) ){
+ if( _is_command_terminator(zLine) && _is_complete(zSql, nSql) ){
memcpy(zLine,";",2);
}
nSqlPrior = nSql;
for(i=0; zLine[i] && isspace((unsigned char)zLine[i]); i++){}
if( zLine[i]!=0 ){
nSql = strlen30(zLine);
- zSql = malloc( nSql+1 );
+ zSql = malloc( nSql+3 );
if( zSql==0 ){
fprintf(stderr, "out of memory\n");
exit(1);
}
}else{
int len = strlen30(zLine);
- zSql = realloc( zSql, nSql + len + 2 );
+ zSql = realloc( zSql, nSql + len + 4 );
if( zSql==0 ){
fprintf(stderr,"%s: out of memory!\n", Argv0);
exit(1);