From: drh Date: Sat, 21 Mar 2020 03:40:21 +0000 (+0000) Subject: Back out the sqlite3_stmt_mode() and EXPLAIN TABLES enhancements, but keep X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fda3dd5e67a01de13aadf8c91cb4b3f1b493eb04;p=thirdparty%2Fsqlite.git Back out the sqlite3_stmt_mode() and EXPLAIN TABLES enhancements, but keep the other miscellaneous improvements to EXPLAIN that were implemented while adding the above: Turn magic numbers into symbolic constants. Add the sqlite3MemPrint() interface accessible to the debugger. Improve the performance and reduce the code size. FossilOrigin-Name: 62aece66774587590bf7f88883cca1c1e76866e9df93bb1a17c4d9db894f06aa --- diff --git a/manifest b/manifest index f536165bab..300b131523 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sEXPLAIN\sTABLES\ssyntax\sthat\suses\sSQLITE_STMTMODE_TABLELIST.\s\sSeems\nto\swork,\sbut\snot\swell-tested. -D 2020-03-20T20:00:10.751 +C Back\sout\sthe\ssqlite3_stmt_mode()\sand\sEXPLAIN\sTABLES\senhancements,\sbut\skeep\nthe\sother\smiscellaneous\simprovements\sto\sEXPLAIN\sthat\swere\simplemented\swhile\nadding\sthe\sabove:\s\sTurn\smagic\snumbers\sinto\ssymbolic\sconstants.\nAdd\sthe\ssqlite3MemPrint()\sinterface\saccessible\sto\sthe\sdebugger.\s\sImprove\nthe\sperformance\sand\sreduce\sthe\scode\ssize. +D 2020-03-21T03:40:21.764 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -520,7 +520,7 @@ F src/os_win.c 035a813cbd17f355bdcad7ab894af214a9c13a1db8aeac902365350b98cd45a7 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c a71ffd145f55e28cbdc1bdabb5e6bef063da428a6c0de3c3a36e9a0c41d4c8c0 F src/pager.h 3b33619a90180e0874c7eca31d6f6ceb464d9322c6fb4e9a7bbb318c8a17bdb3 -F src/parse.y dc4521689a9d91b9da0c74ec02ccc6529d4610eece436cdf21c53ca167fd2a93 +F src/parse.y 8575183809cf30f8c9d1fbea65ca34d1de78b659792bc7c42681e01fc596b520 F src/pcache.c 385ff064bca69789d199a98e2169445dc16e4291fa807babd61d4890c3b34177 F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586 F src/pcache1.c 6596e10baf3d8f84cc1585d226cf1ab26564a5f5caf85a15757a281ff977d51a @@ -533,15 +533,15 @@ F src/resolve.c ad43b2ed4bea58abca3092993382aa2ac91b89144d2066faae4ac924b39396f9 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 128d9d6996eca5e0db686495559b6588f197ef1b6643fa8ec4914861226ff021 F src/shell.c.in f76590931c0cbbfef347f44f81ade6b335f80c46bc6e59b8b6114383a8df30e0 -F src/sqlite.h.in 416ef92b6b08bfb9a31de8001eb5d44243ecda036224421623cc8e5fdfdf1528 +F src/sqlite.h.in 802957feeb249ede54f8dfe99b72aa19e70a0b7737969c46e625dc2f9f2d42b0 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 9c5269260409eb3275324ccace6a13a96f4ad330c708415f70ca6097901ff4ee -F src/sqliteInt.h 5f74c1c52b152259ee07f241821620f11736e4f590936cfaf1cbbff9a2f563d3 +F src/sqliteInt.h f2cef459c6c2394084bc794eb2b79eb15684c351162191ed368e73523dea91ac F src/sqliteLimit.h 95cb8479ca459496d9c1c6a9f76b38aee12203a56ce1092fe13e50ae2454c032 F src/status.c 9ff2210207c6c3b4d9631a8241a7d45ab1b26a0e9c84cb07a9b5ce2de9a3b278 F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34 F src/tclsqlite.c d0aa320416efe88c4dbb0156ed6c494f2f9958871a940e46984ee57b3e7fcc50 -F src/test1.c 93cc6cb90fd708c1822ab74543fd586e4d3510236db24ddcc5ef046f74a4b19c +F src/test1.c 5e8b8cc54e8c88906ea8a084387aa79bad245e539f4cee73149e5c0527e1db16 F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5 F src/test3.c 61798bb0d38b915067a8c8e03f5a534b431181f802659a6616f9b4ff7d872644 F src/test4.c 405834f6a93ec395cc4c9bb8ecebf7c3d8079e7ca16ae65e82d01afd229694bb @@ -605,9 +605,9 @@ F src/util.c a285c1e026907b69fa2592bd05047a565a1d8a1aef2b73c924b6a8ffe772871a F src/vacuum.c 813b510ba887fee6492bcb11f2bf77d7eb58b232b83649136372e0a2fc17f4b9 F src/vdbe.c b7b9ec1d604a12f4cafedf796027a297bc306f0d3afb340948898256cb4473b9 F src/vdbe.h 51282fbe819ee0e8eeeaab176240860d334c20a12b14f3b363e7f1a4e05d60b9 -F src/vdbeInt.h 1a8807b7dfac4142f5b9047767295327be41f02c17f7bb6bd8ffef6219dac588 -F src/vdbeapi.c d840fb3b80bbbd25fd44e1bb2d4a209e297832f527d21ea718fa53502a2a2d97 -F src/vdbeaux.c 66dcae8b09af6c2213da7cfb4ca9ad6e8c4be5d4c1b8dd3eb8c5a1ada9e36ec0 +F src/vdbeInt.h 37a1cb667c80b4cbceb80a7b3947e3b15892cc84bff0cde788ec1781cfab5bde +F src/vdbeapi.c d7540ad79510d3baa30a09db93f305e3d12f069dbd7bd49ebed51b14a3024681 +F src/vdbeaux.c 99703bb60f4f7f7700f801510cb9732e50abfcf5ba65958121c017dcd595d78e F src/vdbeblob.c 253ed82894924c362a7fa3079551d3554cd1cdace39aa833da77d3bc67e7c1b1 F src/vdbemem.c 39b942ecca179f4f30a32b54579a85d74ccaefa5af2a0ad2700abe5ef0768b22 F src/vdbesort.c 2be76d26998ce2b3324cdcc9f6443728e54b6c7677c553ad909c7d7cfab587df @@ -1788,7 +1788,7 @@ F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/mkautoconfamal.sh 422fc365358a2e92876ffc62971a0ff28ed472fc8bcf9de0df921c736fdeca5e F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x F tool/mkctimec.tcl dd183b73ae1c28249669741c250525f0407e579a70482371668fd5f130d9feb3 -F tool/mkkeywordhash.c cb015b0376aea574f00b3b7f7b8e8a43cb52c8adffb2d292454d27aa2567a7b4 +F tool/mkkeywordhash.c 11a3f3af8e787d0c5ca459ed66fe80fd09e661876506e7b978ec08c19477bdc2 F tool/mkmsvcmin.tcl 6ecab9fe22c2c8de4d82d4c46797bda3d2deac8e763885f5a38d0c44a895ab33 F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c F tool/mkopcodeh.tcl 352a4319c0ad869eb26442bf7c3b015aa15594c21f1cce5a6420dbe999367c21 @@ -1860,7 +1860,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 5eaba9af1c35ea7b7c08cad7d0d9b5a4b63b11b3177bb84a570ce1cea44b9f57 -R b8dc18a0109dd1b6247089b6701d54e2 +P e7343ce7514f61eb1aeba22ab83da5b05779080db394332e2e90b4d54cabe123 +R b39cb192f1a90aeded8f742f9e8ca7a0 +T *branch * explain-improvements +T *sym-explain-improvements * +T -sym-sqlite3_stmt_mode * U drh -Z 13571b2afccf3e4212df912e00f6dcfa +Z bb6144a2aea448bb5177f4cac3139da9 diff --git a/manifest.uuid b/manifest.uuid index a221d3fed1..fa08dcedf5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e7343ce7514f61eb1aeba22ab83da5b05779080db394332e2e90b4d54cabe123 \ No newline at end of file +62aece66774587590bf7f88883cca1c1e76866e9df93bb1a17c4d9db894f06aa \ No newline at end of file diff --git a/src/parse.y b/src/parse.y index 48b9ddc0f5..c321daf195 100644 --- a/src/parse.y +++ b/src/parse.y @@ -120,10 +120,9 @@ cmdlist ::= ecmd. ecmd ::= SEMI. ecmd ::= cmdx SEMI. %ifndef SQLITE_OMIT_EXPLAIN -ecmd ::= explain cmdx SEMI. {NEVER-REDUCE} -explain ::= EXPLAIN. { pParse->explain = SQLITE_STMTMODE_EXPLAIN; } -explain ::= EXPLAIN QUERY PLAN. { pParse->explain = SQLITE_STMTMODE_EQP; } -explain ::= EXPLAIN TABLES. { pParse->explain = SQLITE_STMTMODE_TABLELIST; } +ecmd ::= explain cmdx SEMI. {NEVER-REDUCE} +explain ::= EXPLAIN. { pParse->explain = 1; } +explain ::= EXPLAIN QUERY PLAN. { pParse->explain = 2; } %endif SQLITE_OMIT_EXPLAIN cmdx ::= cmd. { sqlite3FinishCoding(pParse); } diff --git a/src/sqlite.h.in b/src/sqlite.h.in index f97d4f65d0..7b2049ae0a 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -4132,88 +4132,14 @@ int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); ** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement ** METHOD: sqlite3_stmt ** -** ^The sqlite3_stmt_isexplain(S) interface returns [SQLITE_STMTMODE_EXPLAIN] -** if the prepared statement S is an EXPLAIN statement, or -** [SQLITE_STMTMODE_EQP] if the* statement S is an [EXPLAIN QUERY PLAN]. -** ^The sqlite3_stmt_isexplain(S) interface returns [SQLITE_STMTMODE_RUN] -** if S is an ordinary statement or a NULL pointer. -** -** The sqlite3_stmt_isexplain(S) call is the same thing as -** [sqlite3_stmt_mode](S, [SQLITE_STMTMODE_QUERY]). +** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the +** prepared statement S is an EXPLAIN statement, or 2 if the +** statement S is an EXPLAIN QUERY PLAN. +** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is +** an ordinary statement or a NULL pointer. */ int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); -/* -** CAPI3REF: Set Or Query The Operating Mode For A Prepared Statement -** METHOD: sqlite3_stmt -** -** The sqlite3_stmt_mode(S,M) attempts to change the "mode" of -** statement S to value M, where M is one of the -** [SQLITE_STMTMODE_RUN|statement mode constants]. The value -** of the statement mode (after the change) is returned. The mode -** change might be disallowed, for example if the statement is currently -** in use or for other reasons listed below. If the mode change is -** disallowed, then the original mode is returned. The only way to -** determine if mode change was effective is to compare the return value -** against the second parameter to see if they are the same. -** -** The mode cannot be changed to SQLITE_STMTMODE_RUN unless the prepared -** statement was originally compiled without either the "EXPLAIN" or -** "EXPLAIN QUERY PLAN" prefix. -** -** The mode cannot be changed to SQLITE_STMTMODE_EQP unless the -** statement was originally compiled using the "EXPLAIN QUERY PLAN" -** prefix. -** -** If M is SQLITE_STMTMODE_QUERY, then the mode is not changed but the -** current mode is still returned. This can be used to query the mode -** of a statement without changing it. -*/ -int sqlite3_stmt_mode(sqlite3_stmt*,int); - -/* CAPI3REF: Prepared Statement Modes -** -** These integer constants are used as the second parameter and the -** return value from the [sqlite3_stmt_mode()] interface and as the -** return value from [sqlite3_stmt_isexplain()]. -** -** -*/ -#define SQLITE_STMTMODE_RUN 0 -#define SQLITE_STMTMODE_EXPLAIN 1 -#define SQLITE_STMTMODE_EQP 2 -#define SQLITE_STMTMODE_TABLELIST 3 -#define SQLITE_STMTMODE_QUERY (-1) - /* ** CAPI3REF: Determine If A Prepared Statement Has Been Reset ** METHOD: sqlite3_stmt diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 7a00b576a0..1fb84d5bcf 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -3370,6 +3370,13 @@ struct Parse { #define PARSE_MODE_RENAME 2 #define PARSE_MODE_UNMAP 3 +/* +** Allowed values for Vdbe.explain and Parse.explain +*/ +#define SQLITE_STMTMODE_RUN 0 +#define SQLITE_STMTMODE_EXPLAIN 1 +#define SQLITE_STMTMODE_EQP 2 + /* ** Sizes and pointers of various parts of the Parse object. */ diff --git a/src/test1.c b/src/test1.c index 78d4f897b1..29207d51ac 100644 --- a/src/test1.c +++ b/src/test1.c @@ -2697,10 +2697,9 @@ static int SQLITE_TCLAPI test_stmt_readonly( /* ** Usage: sqlite3_stmt_isexplain STMT -** Usage: sqlite3_stmt_mode STMT NEWMODE ** -** Return integers 0, 1, 2, or 3 depending on the mode of STMT. If the -** 2nd argument is provided, change the mode to the integer in that argument. +** Return 1, 2, or 0 respectively if STMT is an EXPLAIN statement, an +** EXPLAIN QUERY PLAN statement or an ordinary statement or NULL pointer. */ static int SQLITE_TCLAPI test_stmt_isexplain( void * clientData, @@ -2711,19 +2710,14 @@ static int SQLITE_TCLAPI test_stmt_isexplain( sqlite3_stmt *pStmt; int rc; - if( objc!=2 && objc!=3 ){ + if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetStringFromObj(objv[0], 0), " STMT", 0); return TCL_ERROR; } + if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - if( objc==3 ){ - int iNewMode = SQLITE_STMTMODE_QUERY; - if( Tcl_GetIntFromObj(interp, objv[2], &iNewMode) ) return TCL_ERROR; - rc = sqlite3_stmt_mode(pStmt, iNewMode); - }else{ - rc = sqlite3_stmt_isexplain(pStmt); - } + rc = sqlite3_stmt_isexplain(pStmt); Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); return TCL_OK; } @@ -7982,7 +7976,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ { "sqlite3_next_stmt", test_next_stmt ,0 }, { "sqlite3_stmt_readonly", test_stmt_readonly ,0 }, { "sqlite3_stmt_isexplain", test_stmt_isexplain,0 }, - { "sqlite3_stmt_mode", test_stmt_isexplain,0 }, { "sqlite3_stmt_busy", test_stmt_busy ,0 }, { "uses_stmt_journal", uses_stmt_journal ,0 }, diff --git a/src/vdbeInt.h b/src/vdbeInt.h index 5a40e29e78..07e3306938 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -420,7 +420,6 @@ struct Vdbe { u8 minWriteFileFormat; /* Minimum file format for writable database files */ u8 prepFlags; /* SQLITE_PREPARE_* flags */ u8 explain:2; /* True if EXPLAIN present on SQL command */ - u8 origExplain:2; /* The original value of explain */ u8 expired:2; /* 1: recompile VM immediately 2: when convenient */ u8 doingRerun:1; /* True if rerunning after an auto-reprepare */ u8 changeCntOn:1; /* True to update the change-counter */ @@ -460,6 +459,13 @@ struct Vdbe { #define VDBE_MAGIC_RESET 0x48fa9f76 /* Reset and ready to run again */ #define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */ +/* +** Values for Vdbe.explain +*/ +#define SQLITE_STMTMODE_RUN 0 +#define SQLITE_STMTMODE_EXPLAIN 1 +#define SQLITE_STMTMODE_EQP 2 + /* ** Structure used to store the context required by the ** sqlite3_preupdate_*() API functions. diff --git a/src/vdbeapi.c b/src/vdbeapi.c index dda71d64e6..4a6275e90e 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -999,12 +999,11 @@ int sqlite3_column_count(sqlite3_stmt *pStmt){ static const u8 anColumn[] = { 0, /* SQLITE_STMTMODE_RUN (Use pVm->nResColumn instead) */ 8, /* SQLITE_STMTMODE_EXPLAIN */ - 4, /* SQLITE_STMTMODE_EQP */ - 5 /* SQLITE_STMTMODE_TABLELIST */ + 4 /* SQLITE_STMTMODE_EQP */ }; Vdbe *pVm = (Vdbe *)pStmt; if( pVm==0 ) return 0; - assert( pVm->explain>=0 && pVm->explain<=3 ); + assert( pVm->explain>=0 && pVm->explain<=2 ); if( pVm->explain==0 ) return pVm->nResColumn; return (int)anColumn[pVm->explain]; } @@ -1693,24 +1692,6 @@ int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt){ return pStmt ? ((Vdbe*)pStmt)->explain : 0; } -/* -** Query or set the mode for a prepared statement. -*/ -int sqlite3_stmt_mode(sqlite3_stmt *pStmt, int iNewMode){ - Vdbe *v; - if( pStmt==0 ) return SQLITE_STMTMODE_RUN; - v = (Vdbe*)pStmt; - if( iNewMode==SQLITE_STMTMODE_EXPLAIN - || iNewMode==SQLITE_STMTMODE_TABLELIST - || iNewMode==v->origExplain - ){ - if( v->magic==VDBE_MAGIC_RUN && v->pc<0 ){ - v->explain = iNewMode; - } - } - return v->explain; -} - /* ** Return true if the prepared statement is in need of being reset. */ diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 613753bfdf..6fc9c3bb8c 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1986,8 +1986,7 @@ Mem *sqlite3VdbeSetExplainColumnNames(Vdbe *p){ if( p->nColName<=n ){ static const char * const azColName[] = { "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment", - "id", "parent", "notused", "detail", - "schema", "name", "type", "rw", "src" + "id", "parent", "notused", "detail" }; int iFirst, cnt, i; Mem *pNew = sqlite3DbRealloc(p->db, p->aColName, @@ -2001,12 +2000,9 @@ Mem *sqlite3VdbeSetExplainColumnNames(Vdbe *p){ if( p->explain==SQLITE_STMTMODE_EXPLAIN ){ iFirst = 0; cnt = 8; - }else if( p->explain==SQLITE_STMTMODE_EQP ){ + }else{ iFirst = 8; cnt = 4; - }else{ - iFirst = 12; - cnt = 5; } assert( cnt<=VDBE_EXPLAIN_COLS ); for(i=0; iexplain==SQLITE_STMTMODE_EXPLAIN - || p->explain==SQLITE_STMTMODE_EQP - || p->explain==SQLITE_STMTMODE_TABLELIST ); + || p->explain==SQLITE_STMTMODE_EQP ); assert( p->magic==VDBE_MAGIC_RUN ); assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); @@ -2140,15 +2135,10 @@ int sqlite3VdbeList( } if( p->explain==SQLITE_STMTMODE_EXPLAIN ){ break; /* Show every bytecode line for SQLITE_STMTMODE_EXPLAIN */ - }else if( p->explain==SQLITE_STMTMODE_EQP ){ + }else{ /* Only OP_Init and OP_Explain opcodes are significant for EQP */ if( pOp->opcode==OP_Explain ) break; if( pOp->opcode==OP_Init && p->pc>1 ) break; - }else{ - /* TABLELIST wants OP_Open opcodes only */ - if( pOp->opcode==OP_OpenRead ) break; - if( pOp->opcode==OP_OpenWrite && (pOp->p5 & OPFLAG_P2ISREG)==0 ) break; - if( pOp->opcode==OP_ReopenIdx ) break; } } @@ -2157,42 +2147,6 @@ int sqlite3VdbeList( p->rc = SQLITE_INTERRUPT; rc = SQLITE_ERROR; sqlite3VdbeError(p, sqlite3ErrStr(p->rc)); - }else if( p->explain==SQLITE_STMTMODE_TABLELIST ){ - Schema *pSchema; - HashElem *k; - int iDb = pOp->p3; - int iRoot = pOp->p2; - const char *zName = 0; - const char *zType = 0; - assert( iDb>=0 && iDbnDb ); - sqlite3VdbeMemSetStr(pMem++, db->aDb[iDb].zDbSName, -1, - SQLITE_UTF8, SQLITE_STATIC); - pSchema = db->aDb[iDb].pSchema; - for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ - Table *pTab = (Table*)sqliteHashData(k); - if( !IsVirtual(pTab) && pTab->tnum==iRoot ){ - zName = pTab->zName; - zType = "table"; - break; - } - } - if( zName==0 ){ - for(k=sqliteHashFirst(&pSchema->idxHash); k; k=sqliteHashNext(k)){ - Index *pIdx = (Index*)sqliteHashData(k); - if( pIdx->tnum==iRoot ){ - zName = pIdx->zName; - zType = "index"; - break; - } - } - } - sqlite3VdbeMemSetStr(pMem++, zName, -1, SQLITE_UTF8, SQLITE_STATIC); - sqlite3VdbeMemSetStr(pMem++, zType, 5, SQLITE_UTF8, SQLITE_STATIC); - sqlite3VdbeMemSetInt64(pMem++, pOp->opcode==OP_OpenWrite); - sqlite3VdbeMemSetInt64(pMem++, ipc-1); - p->nRes = 5; - p->rc = SQLITE_OK; - rc = SQLITE_ROW; }else{ char *zP4; if( p->explain==SQLITE_STMTMODE_EXPLAIN ){ @@ -2450,7 +2404,7 @@ void sqlite3VdbeMakeReady( resolveP2Values(p, &nArg); p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort); if( pParse->explain ){ - p->explain = p->origExplain = pParse->explain; + p->explain = pParse->explain; } p->expired = 0; diff --git a/tool/mkkeywordhash.c b/tool/mkkeywordhash.c index e3af0d9a41..83ec179ba0 100644 --- a/tool/mkkeywordhash.c +++ b/tool/mkkeywordhash.c @@ -288,7 +288,6 @@ static Keyword aKeywordTable[] = { { "SELECT", "TK_SELECT", ALWAYS, 10 }, { "SET", "TK_SET", ALWAYS, 10 }, { "TABLE", "TK_TABLE", ALWAYS, 1 }, - { "TABLES", "TK_TABLES", EXPLAIN, 10 }, { "TEMP", "TK_TEMP", ALWAYS, 1 }, { "TEMPORARY", "TK_TEMP", ALWAYS, 1 }, { "THEN", "TK_THEN", ALWAYS, 3 },