From: larrybr Date: Mon, 7 Mar 2022 00:14:52 +0000 (+0000) Subject: Disentangle variable use in last checkin X-Git-Tag: version-3.39.0~331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41f46703b84b12c3d67e053687a9967aa8048cb9;p=thirdparty%2Fsqlite.git Disentangle variable use in last checkin FossilOrigin-Name: 4c3a02600f10926da1f88ddbd457bb1486e6e02dee366b5cfc89e498a10daa6f --- diff --git a/manifest b/manifest index 8702de82a3..1a7976cec9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C For\sCLI\s.import,\srevert\sto\simporting\sinto\stemp\sor\smain\swhen\sgiven\stable\sis\sfound\sthere\sand\sno\s-schema\soption\sused.\sAnd\splug\san\sobscure\sleak. -D 2022-03-06T23:41:21.849 +C Disentangle\svariable\suse\sin\slast\scheckin +D 2022-03-07T00:14:52.499 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -553,7 +553,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 4890a3cfee0bc60ff231c3a44db37968859ab0be156983dbcc0c096109832cdd -F src/shell.c.in 3b4cfb17b0683831b3b42f92f411c311a8757d4e6fac7a1524258a29bbfbadbf +F src/shell.c.in 0a9c4b9226143365c8aea42eb9a62e055e9fffffc5e4559da5c9dadc0bedaa25 F src/sqlite.h.in e82ac380b307659d0892f502b742f825504e78729f4edaadce946003b9c00816 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h a95cb9ed106e3d39e2118e4dcc15a14faec3fa50d0093425083d340d9dfd96e6 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4838b888e431f794b8a5ee65e797b3bf0616c03261de4e1fc9499287eb3e1265 -R 48c484e9a49cdc0f439e995f4d0daf72 +P bf9d1278846dce9255f9a11ddfc5dfac1acea2eadcb20816a19d59f7bccaec0f +R 496fa8a876df6daf353669fc02e2fc4c U larrybr -Z b5862c83f76331b7720ff8f2e107fcd4 +Z 013bf70ae42a0fa3c911efc40e5d2bba # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index dc324d3a48..209490bd9e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bf9d1278846dce9255f9a11ddfc5dfac1acea2eadcb20816a19d59f7bccaec0f \ No newline at end of file +4c3a02600f10926da1f88ddbd457bb1486e6e02dee366b5cfc89e498a10daa6f \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 90445c9cf4..b0f3b02dc4 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -8836,6 +8836,7 @@ static int do_meta_command(char *zLine, ShellState *p){ int needCommit; /* True to COMMIT or ROLLBACK at end */ int nSep; /* Number of bytes in p->colSeparator[] */ char *zSql; /* An SQL statement */ + char *zFullTabName; /* Table name with schema if applicable */ ImportCtx sCtx; /* Reader context */ char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */ int eVerbose = 0; /* Larger for more console output */ @@ -8979,12 +8980,12 @@ static int do_meta_command(char *zLine, ShellState *p){ while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){} } if( zSchema!=0 ){ - zSchema = sqlite3_mprintf("\"%w\".\"%w\"", zSchema, zTable); + zFullTabName = sqlite3_mprintf("\"%w\".\"%w\"", zSchema, zTable); }else{ - zSchema = sqlite3_mprintf("\"%w\"", zTable); + zFullTabName = sqlite3_mprintf("\"%w\"", zTable); } - zSql = sqlite3_mprintf("SELECT * FROM %s", zSchema); - if( zSql==0 || zSchema==0 ){ + zSql = sqlite3_mprintf("SELECT * FROM %s", zFullTabName); + if( zSql==0 || zFullTabName==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); } @@ -8992,7 +8993,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", zSchema); + char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zFullTabName); sqlite3 *dbCols = 0; char *zRenames = 0; char *zColDefs; @@ -9013,7 +9014,7 @@ static int do_meta_command(char *zLine, ShellState *p){ import_fail: sqlite3_free(zCreate); sqlite3_free(zSql); - sqlite3_free(zSchema); + sqlite3_free(zFullTabName); import_cleanup(&sCtx); rc = 1; goto meta_command_exit; @@ -9046,7 +9047,7 @@ static int do_meta_command(char *zLine, ShellState *p){ import_cleanup(&sCtx); shell_out_of_memory(); } - sqlite3_snprintf(nByte+20, zSql, "INSERT INTO %s VALUES(?", zSchema); + sqlite3_snprintf(nByte+20, zSql, "INSERT INTO %s VALUES(?", zFullTabName); j = strlen30(zSql); for(i=1; idb); if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0); do{