From: drh Date: Fri, 16 Sep 2011 22:10:57 +0000 (+0000) Subject: Fix a problem with SQLITE_OMIT_TRACE that was introduced by the recent X-Git-Tag: version-3.7.8~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfd2d9f6c90791914743c6e102980df6dd13845a;p=thirdparty%2Fsqlite.git Fix a problem with SQLITE_OMIT_TRACE that was introduced by the recent OP_Once change. FossilOrigin-Name: 96be3f7b59b3ed4703b907e29db629df34b2b56f --- diff --git a/manifest b/manifest index f21b283051..06663a9554 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\s#if's\sin\swinSync\sto\savoid\scompiler\swarnings\sabout\sunused\slocal\svariables.\s\sAlso,\supdate\sversion\snumbers\sin\sthe\sMSVC\smakefile. -D 2011-09-16T20:43:44.526 +C Fix\sa\sproblem\swith\sSQLITE_OMIT_TRACE\sthat\swas\sintroduced\sby\sthe\srecent\nOP_Once\schange. +D 2011-09-16T22:10:57.198 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in d314143fa6be24828021d3f583ad37d9afdce505 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -133,7 +133,7 @@ F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac F src/ctime.c e3132ec65240b2e2f3d50831021eac387f27584d F src/date.c a3c6842bad7ae632281811de112a8ba63ff08ab3 F src/delete.c ff68e5ef23aee08c0ff528f699a19397ed8bbed8 -F src/expr.c fd54c517869919c9b0b11dcadd43c66540ffa682 +F src/expr.c f4dcaeb8252c4b16fcdc245660f70ed366bc6cdd F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c 9f00ea98f6b360d477b5a78b5b59a1fbde82431c F src/func.c 59bb046d7e3df1ab512ac339ccb0a6f996a17cb7 @@ -962,7 +962,7 @@ F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5 F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings.sh b7fdb2cc525f5ef4fa43c80e771636dd3690f9d2 -P 690220717f3d92d4fb7bd72226fc8d5f38f5fbcf -R 8db2e7132a1227a7b1d23ed92e216603 -U mistachkin -Z 593341d840a3a381b39866ac10a16fed +P 2e66e41457422449ac5918b16be443e737dfb149 +R fc961be987415e6cdb50c0924196d190 +U drh +Z a161e546ae0e6f16b9b8fc71b39898c3 diff --git a/manifest.uuid b/manifest.uuid index b54465fd4d..b33cedd522 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2e66e41457422449ac5918b16be443e737dfb149 \ No newline at end of file +96be3f7b59b3ed4703b907e29db629df34b2b56f \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 6fd08b27f1..d024528d7c 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1574,11 +1574,10 @@ int sqlite3CodeSubselect( int rMayHaveNull, /* Register that records whether NULLs exist in RHS */ int isRowid /* If true, LHS of IN operator is a rowid */ ){ - int testAddr = 0; /* One-time test address */ + int testAddr = -1; /* One-time test address */ int rReg = 0; /* Register storing resulting */ Vdbe *v = sqlite3GetVdbe(pParse); if( NEVER(v==0) ) return 0; - assert( sqlite3VdbeCurrentAddr(v)>0 ); sqlite3ExprCachePush(pParse); /* This code must be run in its entirety every time it is encountered @@ -1594,13 +1593,12 @@ int sqlite3CodeSubselect( if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){ int mem = ++pParse->nMem; testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem); - assert( testAddr>0 || pParse->db->mallocFailed ); } #ifndef SQLITE_OMIT_EXPLAIN if( pParse->explain==2 ){ char *zMsg = sqlite3MPrintf( - pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ", + pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ", pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId ); sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); @@ -1692,9 +1690,9 @@ int sqlite3CodeSubselect( ** this code only executes once. Because for a non-constant ** expression we need to rerun this code each time. */ - if( testAddr && !sqlite3ExprIsConstant(pE2) ){ + if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){ sqlite3VdbeChangeToNoop(v, testAddr); - testAddr = 0; + testAddr = -1; } /* Evaluate the expression and insert it into the temp table */ @@ -1763,7 +1761,7 @@ int sqlite3CodeSubselect( } } - if( testAddr ){ + if( testAddr>=0 ){ sqlite3VdbeJumpHere(v, testAddr); } sqlite3ExprCachePop(pParse, 1);