From: drh Date: Wed, 5 Dec 2018 23:56:02 +0000 (+0000) Subject: Get rid of the hash table used to track IN operators in the X-Git-Tag: version-3.27.0~326 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b278f0c3d6a45b3f9bf849c7a703196fa54bae2;p=thirdparty%2Fsqlite.git Get rid of the hash table used to track IN operators in the sqlite3_normalized_sql() implementation. Use simple integer variables instead. FossilOrigin-Name: 272dc74fd0304d6a28aaa8798d13e2f950c1a24d92d17519e3c32aef86714586 --- diff --git a/manifest b/manifest index a8462726b9..41eeb7cb19 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\ssqlite3_normalized_sql()\sinterface\sshould\snot\sbe\stransforming\squoted\nidentifier\snames\sinto\swildcards.\s\sFix\sthis,\sand\sat\sthe\ssame\stime\ssimplify\nthe\scode\ssubstantially. -D 2018-12-05T23:45:46.950 +C Get\srid\sof\sthe\shash\stable\sused\sto\strack\sIN\soperators\sin\sthe\nsqlite3_normalized_sql()\simplementation.\s\sUse\ssimple\sinteger\svariables\ninstead. +D 2018-12-05T23:56:02.639 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in 68d0ba0f0b533d5bc84c78c13a6ce84ee81183a67014caa47a969e67f028fa1c @@ -502,7 +502,7 @@ F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586 F src/pcache1.c ad0ffc5b35b0280d045ac569d34d4b842e3e6a4a118f6396b320987a0957afcc F src/pragma.c 4e056f042683b99c4ea0db395f68d051b1a95833ab40951c40d3ef7e1fee1354 F src/pragma.h fdd03d78a7497f74a3f652909f945328480089189526841ae829ce7313d98d13 -F src/prepare.c 90099721296d9646addc5dda092464da21546e7410406818dde1600467b120c4 +F src/prepare.c 66b5f9791a3ef57131cbba58c33104ebea814a70a5cfcafabf5aed5a3e3858fe F src/printf.c 0f1177cf1dd4d7827bf64d840768514ec76409abecaca9e8b577dbd065150381 F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 F src/resolve.c 976e7879286a1eecdc71ceff64f6d1b3f58c8f8096537ba668b3dc0887f410c1 @@ -1782,7 +1782,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 f69624373e33c4d370a9264a317ffdb0adbce967a950f243de2b41161a8c7ded -R f3aa45194b952de0676e91bd1b04c704 +P e8540377ec66fa5f9ae3c93bedb5c094057698199c37fc211f7ea95429e815e4 +R d3461cbb797157ae329a2dd1a53cba4d U drh -Z 5f1f0ed88784c364d2e88ebae6a00a1f +Z ad7226daa41778e03500de0c126598a5 diff --git a/manifest.uuid b/manifest.uuid index 8c94029b26..41f2aab1d9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e8540377ec66fa5f9ae3c93bedb5c094057698199c37fc211f7ea95429e815e4 \ No newline at end of file +272dc74fd0304d6a28aaa8798d13e2f950c1a24d92d17519e3c32aef86714586 \ No newline at end of file diff --git a/src/prepare.c b/src/prepare.c index 76598e25d2..c470a54bda 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -793,7 +793,8 @@ char *sqlite3Normalize( int prevTokenType = 0; /* Type of the previous token, except spaces */ int n; /* Size of the next token */ int nParen = 0; /* Nesting level of parenthesis */ - Hash inHash; /* Table of parenthesis levels to output index. */ + int iStartIN = 0; /* Start of RHS of IN operator in z[] */ + int nParenAtIN = 0; /* Value of nParent at start of RHS of IN operator */ db = sqlite3VdbeDb(pVdbe); assert( db!=0 ); @@ -801,7 +802,6 @@ char *sqlite3Normalize( nZ = estimateNormalizedSize(zSql, nSql); z = sqlite3DbMallocRawNN(db, nZ); if( z==0 ) goto normalizeError; - sqlite3HashInit(&inHash); for(i=j=0; i0 ){ - sqlite3HashInsert(&inHash, zSql+nParen, 0); - assert( jj+60 && nParen==nParenAtIN ){ + assert( iStartIN+6=0 ); assert( nZ-1-j0 ){ - assert( nParen0 && z[j-1]!=';' ){ z[j++] = ';'; } z[j] = 0; assert( j