From: drh Date: Mon, 20 May 2019 18:35:49 +0000 (+0000) Subject: A minor variation on check-in [1685610ef8e0dc] which (hopefully) makes the X-Git-Tag: version-3.29.0~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e4f6c43b88e4e41912719b1678afb0c187def23;p=thirdparty%2Fsqlite.git A minor variation on check-in [1685610ef8e0dc] which (hopefully) makes the logic a little easier to follow. Also disallows the use of the double-quoted string hack in the query expression used for VACUUM INTO, which is not strictly required, but moves us toward the goal of disallowing the double-quoted string hack everywhere. FossilOrigin-Name: 3e1b55f3ab85710ed81574904718205c7370b5f0b5a41029e961486d2e3f37c7 --- diff --git a/manifest b/manifest index 1eaaa80fbf..b7c519ebfc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Disallow\sstring\sconstants\senclosed\sin\sdouble-quotes\swithin\snew\sCREATE\sTABLE\sand\sCREATE\sINDEX\sstatements.\sIt\sis\sstill\spossible\sto\senclose\scolumn\snames\sin\sdouble-quotes,\sand\sexisting\sdatabase\sschemas\sthat\suse\sdouble-quotes\sfor\sstrings\scan\sstill\sbe\sloaded.\sThis\saddresses\sticket\s[9b78184b]. -D 2019-05-20T17:14:25.060 +C A\sminor\svariation\son\scheck-in\s[1685610ef8e0dc]\swhich\s(hopefully)\smakes\sthe\nlogic\sa\slittle\seasier\sto\sfollow.\s\sAlso\sdisallows\sthe\suse\sof\sthe\sdouble-quoted\nstring\shack\sin\sthe\squery\sexpression\sused\sfor\sVACUUM\sINTO,\swhich\sis\snot\nstrictly\srequired,\sbut\smoves\sus\stoward\sthe\sgoal\sof\sdisallowing\sthe\sdouble-quoted\nstring\shack\severywhere. +D 2019-05-20T18:35:49.273 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -520,14 +520,14 @@ F src/pragma.h 482c26f352efd7a4ed1354d83ffa992e13004f6528edeee44cdbfd5025a490bd F src/prepare.c 78027c6231fbb19ca186a5f5f0c0a1375d9c2cec0655273f9bd90d9ff74a34b3 F src/printf.c 67f79227273a9009d86a017619717c3f554f50b371294526da59faa6014ed2cd F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 -F src/resolve.c 0b046cc3d4d980c92d37200b0d1c4d4c4685103d82734162aa991f965f01b1cb +F src/resolve.c bae0a7562db77b02d87101b587819d5a5dcd8625e477d2d8a228a20bba4fead6 F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93 F src/select.c c620bcd03b1fbf9fed7d0e49c5e32bea3233c3f7c67d896271c36d6e5a4c621c F src/shell.c.in 6c992809abf20dbb4aad89299d7c15c98ddf2504b23c83ef71eb435ad392cdc3 F src/sqlite.h.in d19c873a17c2effd4417f687fad942b6cc0ab0c64535f669cc2f22a5b05db23b F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5 -F src/sqliteInt.h 4f3edd821ba26fd226a98cec496de1a610460824accbc59dad9640fee5c5b232 +F src/sqliteInt.h edde1d3fa1e267a9b57ed39ca9293994ab957e45298af4681f4a71f584a8e415 F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b F src/status.c 46e7aec11f79dad50965a5ca5fa9de009f7d6bde08be2156f1538a0a296d4d0e F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34 @@ -1827,7 +1827,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 99eba69b3a64741c69d167bf7a05dbe138c9e7faecc54a1b8d8220cb23902830 -R d198ec0c1dbc6e91f8bbe5cf32cf98a3 -U dan -Z 7143d8b31f164a671db524d2917365c4 +P 1685610ef8e0dc9218b02461ceab14dc6114f4f5ef7fcda0da395094aff443e1 +R 1113170f9c5e5be87c5119deda88593e +U drh +Z cb44fd552c668e19c46ce895661ff940 diff --git a/manifest.uuid b/manifest.uuid index f0bf5c08d4..6bb3086cda 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1685610ef8e0dc9218b02461ceab14dc6114f4f5ef7fcda0da395094aff443e1 \ No newline at end of file +3e1b55f3ab85710ed81574904718205c7370b5f0b5a41029e961486d2e3f37c7 \ No newline at end of file diff --git a/src/resolve.c b/src/resolve.c index c8cce58685..65906da90c 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -477,7 +477,7 @@ static int lookupName( if( cnt==0 && zTab==0 ){ assert( pExpr->op==TK_ID ); if( ExprHasProperty(pExpr,EP_DblQuoted) - && 0==(pTopNC->ncFlags&NC_NewSchema) + && 0==(pTopNC->ncFlags&NC_NoDblQStr) ){ /* If a double-quoted identifier does not match any known column name, ** then treat it as a string. @@ -1771,8 +1771,8 @@ int sqlite3ResolveSelfReference( sNC.pParse = pParse; sNC.pSrcList = &sSrc; sNC.ncFlags = type; - if( pTab && !pParse->db->init.busy && !sqlite3WritableSchema(pParse->db) ){ - sNC.ncFlags |= NC_NewSchema; + if( !pParse->db->init.busy && !sqlite3WritableSchema(pParse->db) ){ + sNC.ncFlags |= NC_NoDblQStr; } if( (rc = sqlite3ResolveExprNames(&sNC, pExpr))!=SQLITE_OK ) return rc; if( pList ) rc = sqlite3ResolveExprListNames(&sNC, pList); diff --git a/src/sqliteInt.h b/src/sqliteInt.h index fc4b460029..630239ff4b 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2793,7 +2793,8 @@ struct NameContext { #define NC_Complex 0x2000 /* True if a function or subquery seen */ #define NC_AllowWin 0x4000 /* Window functions are allowed here */ #define NC_HasWin 0x8000 /* One or more window functions seen */ -#define NC_NewSchema 0x10000 /* Currently resolving self-refs for new object */ +#define NC_NoDblQStr 0x10000 /* Do not allow double-quoted string hack. + ** Mnemonic: "NO DouBLe-Quoted STRings" */ /* ** An instance of the following object describes a single ON CONFLICT