Improved quoting of the table name argument for the ".import" command
of the CLI. See [forum:34591fefbe|forum post 34591fefbe]. FossilOrigin-Name: ce97b56d63d6e03b909e049a0a62251d98c7bf643448193a28b42a5871899387
This commit is contained in:
parent
c196219dd4
commit
c6712647c6
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
||||
C Add\soptions\s--data-only\sand\s--nosys\sto\sthe\s".dump"\scommand\sin\sthe\sCLI.
|
||||
D 2020-10-12T16:54:28.560
|
||||
C Improved\squoting\sof\sthe\stable\sname\sargument\sfor\sthe\s".import"\scommand\nof\sthe\sCLI.\s\sSee\s[forum:34591fefbe|forum\spost\s34591fefbe].
|
||||
D 2020-10-12T17:57:29.071
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -538,7 +538,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||
F src/resolve.c 97b91fb25d86881ff20c9ad2ad98412c6c1bb5f7d6c9bb044db250cbc9cfcd4b
|
||||
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
|
||||
F src/select.c 0d9ce195bf062f45390c9f9fa0ab7402e26b57bee51b9f67b3034c32f9fc425a
|
||||
F src/shell.c.in 76abb40d8359be88d4c85ede63ea9c2d9e76528451e8c9dc79bd7978f25fb36f
|
||||
F src/shell.c.in a04bec163dfafef8b14c36430685e73913b93569e7ae839533fa7e8c23837f6e
|
||||
F src/sqlite.h.in cb9f0862e8d0f8691de95b18439ab60666f868c83bc65e3a17f0a0b44cc8f8a9
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 2d1af80082edffd71c6f96f70ad1ce6a4fb46615ad10291fc77fe0dea9ff0197
|
||||
@ -1882,7 +1882,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P bc4bb9433fed519386511796cce475d74100b8ed707cdbffd8cbdf683b0faf35
|
||||
R cf24ea972cca1b42376319e48d3450b3
|
||||
P 57123b14a71027c21cb5eee089fcbc9330d07bf9091b01aecc4f9e3b9e4f7b09
|
||||
R 2333480afe2a6d7122f35f3cc8e2aca4
|
||||
U drh
|
||||
Z e5010285d2215a3aa775df1acaf7bf19
|
||||
Z cf995dab585b2ea13b07668ba4170693
|
||||
|
@ -1 +1 @@
|
||||
57123b14a71027c21cb5eee089fcbc9330d07bf9091b01aecc4f9e3b9e4f7b09
|
||||
ce97b56d63d6e03b909e049a0a62251d98c7bf643448193a28b42a5871899387
|
@ -8225,7 +8225,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
while( (nSkip--)>0 ){
|
||||
while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
|
||||
}
|
||||
zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
|
||||
zSql = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable);
|
||||
if( zSql==0 ){
|
||||
import_cleanup(&sCtx);
|
||||
shell_out_of_memory();
|
||||
@ -8234,7 +8234,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
|
||||
import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
|
||||
if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){
|
||||
char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable);
|
||||
char *zCreate = sqlite3_mprintf("CREATE TABLE \"%w\"", zTable);
|
||||
char cSep = '(';
|
||||
while( xRead(&sCtx) ){
|
||||
zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z);
|
||||
@ -8255,7 +8255,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
|
||||
sqlite3_free(zCreate);
|
||||
if( rc ){
|
||||
utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
|
||||
utf8_printf(stderr, "CREATE TABLE \"%s\"(...) failed: %s\n", zTable,
|
||||
sqlite3_errmsg(p->db));
|
||||
import_cleanup(&sCtx);
|
||||
rc = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user