1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Fix the CLI so that it does not terminate input when an Oracle or MS-SQL

command terminator mark is seen in the middle of a string literal.
Ticket #3490. (CVS 5878)

FossilOrigin-Name: 68662e3b487b80b2c94cd2376060388bd8df0e4e
This commit is contained in:
drh
2008-11-11 00:30:11 +00:00
parent 753cc1077b
commit c717b382b8
3 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
C When\san\sOOM\serror\soccurs\swhile\sresizing\san\ssqlite_value\sobject,\smake\ssure\nthe\svalue\sof\sthe\sobject\sis\sset\sto\sNULL.\s\sTicket\s#3488.\s(CVS\s5877) C Fix\sthe\sCLI\sso\sthat\sit\sdoes\snot\sterminate\sinput\swhen\san\sOracle\sor\sMS-SQL\ncommand\sterminator\smark\sis\sseen\sin\sthe\smiddle\sof\sa\sstring\sliteral.\nTicket\s#3490.\s(CVS\s5878)
D 2008-11-11T00:21:30 D 2008-11-11T00:30:12
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 48172b58e444a9725ec482e0c022a564749acab4 F Makefile.in 48172b58e444a9725ec482e0c022a564749acab4
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -149,7 +149,7 @@ F src/printf.c 785f87120589c1db672e37c6eb1087c456e6f84d
F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51 F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51
F src/resolve.c 266bb03d2b456fe68f5df2dd5687e7e88ff8088d F src/resolve.c 266bb03d2b456fe68f5df2dd5687e7e88ff8088d
F src/select.c 0d79c6c0b48b9d67a443853fd6add8c2967ba870 F src/select.c 0d79c6c0b48b9d67a443853fd6add8c2967ba870
F src/shell.c d83b578a8ccdd3e0e7fef4388a0887ce9f810967 F src/shell.c 33ae5c8ce9e8b1d02e0cd510b3b9de18e3c414ba
F src/sqlite.h.in b73e17f40b0dcfc4b17f5ef18ba90bca8d1e8bc5 F src/sqlite.h.in b73e17f40b0dcfc4b17f5ef18ba90bca8d1e8bc5
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h 1e112bd969e0b318c8ee13d7104d4ae0a30da822 F src/sqliteInt.h 1e112bd969e0b318c8ee13d7104d4ae0a30da822
@@ -654,7 +654,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff 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
P 806b6ed202292e386ac3e51cebcfb67f3870cd2f P 7b9c9b35fffb233e76148182426199d51243fba7
R d1d72399c4198836cc46e37f71d2e131 R c81008349e7f2ff2bbba5c47baedbce9
U drh U drh
Z ffa9723504b4d99f03db9e73564e4aa9 Z ed387cb6e57045ecd55977a2a2952399

View File

@@ -1 +1 @@
7b9c9b35fffb233e76148182426199d51243fba7 68662e3b487b80b2c94cd2376060388bd8df0e4e

View File

@@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line ** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases. ** utility for accessing SQLite databases.
** **
** $Id: shell.c,v 1.185 2008/08/11 19:12:35 drh Exp $ ** $Id: shell.c,v 1.186 2008/11/11 00:30:12 drh Exp $
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -1699,7 +1699,7 @@ static int process_input(struct callback_data *p, FILE *in){
} }
continue; continue;
} }
if( _is_command_terminator(zLine) ){ if( _is_command_terminator(zLine) && sqlite3_complete(zSql) ){
memcpy(zLine,";",2); memcpy(zLine,";",2);
} }
nSqlPrior = nSql; nSqlPrior = nSql;