From: dan Date: Fri, 29 Jun 2018 19:54:51 +0000 (+0000) Subject: Improve on the previous checkin. Still a bit slow. X-Git-Tag: version-3.25.0~178^2~1^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=769309fcf3083a884fe2c77d6fc193d0a409f3ce;p=thirdparty%2Fsqlite.git Improve on the previous checkin. Still a bit slow. FossilOrigin-Name: c1fb41aa7b7207b81ee1d5d32da3380b36d694033b87a2873981e0c6437ba956 --- diff --git a/manifest b/manifest index e6513a564a..f3ee787749 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Instead\sof\susing\sa\slemon\s%fallback\sdirective,\shave\sthe\stokenizer\stry\sto\sfigure\nout\swhether\san\sinstance\sof\s"WINDOW"\sshould\sbe\sTK_WINDOW\sor\sTK_ID. -D 2018-06-29T17:44:52.692 +C Improve\son\sthe\sprevious\scheckin.\sStill\sa\sbit\sslow. +D 2018-06-29T19:54:51.681 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in 0a3a6c81e6fcb969ff9106e882f0a08547014ba463cb6beca4c4efaecc924ee6 @@ -558,7 +558,7 @@ F src/test_windirent.h 90dfbe95442c9762357fe128dc7ae3dc199d006de93eb33ba3972e0a9 F src/test_window.c add59ee68568868129516999f30a68e8ab2afd276e272aba4f633c9fc52c1bb1 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c -F src/tokenize.c e25caaeb2ad912a378e528771d843badbaee560f2eb8c25dbface05a32c2e4cf +F src/tokenize.c c747c0bd913957db6c8d04b990dc89cd7e386403ef32fe23f77182f83fe1c422 F src/treeview.c 2c5c4bc0a443401db5fd621542150452ddf5055d38edd4eef868bc2b6bfb0260 F src/trigger.c 4ace6d1d5ba9a89822deb287317f33c810440526eafe185c2d8a48c31df1e995 F src/update.c 46dc24c6158446aaab45caee09b6d99327cb479268b83ffeb5b701823da3b67b @@ -1744,7 +1744,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 7c4b879bdb10f30260f0fb28fcb559ab0949865d10f4ff2cf13834a326198998 -R 53ad10aee784d2508443a129bf20d430 +P 022079cb0d67be5ac0a50dd9a4d41ee55ce8df681ecd0a544170d75fc8649978 +R 80db462d4d1bca4df50e900a3c59e228 U dan -Z a766b00041899c4982e4087a15ea2a82 +Z d426a5a866f464dd5bcd7eefbf14a41b diff --git a/manifest.uuid b/manifest.uuid index 2825dfd995..0463aaf42f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -022079cb0d67be5ac0a50dd9a4d41ee55ce8df681ecd0a544170d75fc8649978 \ No newline at end of file +c1fb41aa7b7207b81ee1d5d32da3380b36d694033b87a2873981e0c6437ba956 \ No newline at end of file diff --git a/src/tokenize.c b/src/tokenize.c index 10ad25e29f..cfd631344b 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -222,20 +222,21 @@ static int windowGetToken(const unsigned char **pz){ ** uses windowGetToken(). This is to avoid recursion if the input is similar ** to "window window window window". */ -static void analyzeWindowKeyword(const unsigned char *z, int *tokenType){ +static int analyzeWindowKeyword(const unsigned char *z){ int t; - assert( *tokenType==TK_WINDOW ); + int ret = TK_WINDOW; while( (t = windowGetToken(&z))==TK_SPACE ); if( t!=TK_ID && t!=TK_STRING && t!=TK_JOIN_KW && sqlite3ParserFallback(t)!=TK_ID ){ - *tokenType = TK_ID; + ret = TK_ID; }else{ while( (t = windowGetToken(&z))==TK_SPACE ); if( t!=TK_AS ){ - *tokenType = TK_ID; + ret = TK_ID; } } + return ret; } /* @@ -482,12 +483,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ break; } *tokenType = TK_ID; - keywordCode((char*)z, i, tokenType); - if( *tokenType==TK_WINDOW ){ - assert( i==6 ); - analyzeWindowKeyword(&z[6], tokenType); - } - return i; + return keywordCode((char*)z, i, tokenType); } case CC_X: { #ifndef SQLITE_OMIT_BLOB_LITERAL @@ -594,6 +590,9 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ } zSql += n; }else{ + if( tokenType==TK_WINDOW ){ + tokenType = analyzeWindowKeyword((const u8*)&zSql[6]); + } pParse->sLastToken.z = zSql; pParse->sLastToken.n = n; sqlite3Parser(pEngine, tokenType, pParse->sLastToken);