From: dan Date: Tue, 2 Aug 2016 17:45:00 +0000 (+0000) Subject: Fix SQLITE_OMIT_SUBQUERY builds. X-Git-Tag: version-3.15.0~110^2~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9b2e05c75e55ca795caa825bfcba1c0760ea35f;p=thirdparty%2Fsqlite.git Fix SQLITE_OMIT_SUBQUERY builds. FossilOrigin-Name: 339f85f414a484e44d2502d1ff7281caf9b7c838 --- diff --git a/manifest b/manifest index ba89d2088a..c6971b1622 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\swith\svector\srange\sconstraints\sand\smixed\sASC/DESC\sindexes. -D 2016-08-02T17:07:51.146 +C Fix\sSQLITE_OMIT_SUBQUERY\sbuilds. +D 2016-08-02T17:45:00.556 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233 @@ -337,7 +337,7 @@ F src/ctime.c e77f3dc297b4b65c96da78b4ae4272fdfae863d7 F src/date.c 1cc9fb516ec9932c6fd4d2a0d2f8bc4480145c39 F src/dbstat.c 4f6f7f52b49beb9636ffbd517cfe44a402ba4ad0 F src/delete.c 4aba4214a377ce8ddde2d2e609777bcc8235200f -F src/expr.c 4db65a0c33003a00314fb56dca32d9cdbb6448a6 +F src/expr.c 200cad2bc4eaaea03d36d1a13c47a90f6595154d F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c bc4145347595b7770f9a598cff1c848302cf5413 F src/func.c 61a4114cf7004f10c542cfabbab9f2bcb9033045 @@ -388,7 +388,7 @@ F src/shell.c 79dda477be6c96eba6e952a934957ad36f87acc7 F src/sqlite.h.in e011dcc3942e6ddc8dd7b894e9e6702e4269161e F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae -F src/sqliteInt.h ccfffd24330a373a971fee69b6b06a9b7e9ddced +F src/sqliteInt.h 9d6623807cc94dfa49d0eab6380ad77091e97019 F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247 F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1 F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9 @@ -465,7 +465,7 @@ F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2 F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354 F src/where.c 25eae2e051809c75a8a1a23288f335382ac0215f F src/whereInt.h 14dd243e13b81cbb0a66063d38b70f93a7d6e613 -F src/wherecode.c c01c8af9311b5d6d65de311101f72d94a11ae506 +F src/wherecode.c c2392fa30bcb0c555a8ae402d646b357ca428ad6 F src/whereexpr.c 4a8cefc7c122132ac9f3ed125c61629a0e3de094 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd @@ -1513,7 +1513,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 d468101b421e073e9debd7381bde1d36af31369e -R e4db8db490358e0865afed7cef96935f +P e2ad30c8b5366fd8e50f36c62345ed03ec613c47 +R 4d69da3a911755cf5dde753475b8adf2 U dan -Z 8c6bb4cf90fd1cc092b885dc43b4c6ef +Z aa590e568ce86faba8eaef4a3eef0582 diff --git a/manifest.uuid b/manifest.uuid index 9c30fb99ac..fc2a84a3ab 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e2ad30c8b5366fd8e50f36c62345ed03ec613c47 \ No newline at end of file +339f85f414a484e44d2502d1ff7281caf9b7c838 \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 53c00952f3..c469b463e2 100644 --- a/src/expr.c +++ b/src/expr.c @@ -332,6 +332,7 @@ int sqlite3ExprVectorSize(Expr *pExpr){ return pExpr->x.pList->nExpr; } +#ifndef SQLITE_OMIT_SUBQUERY /* ** If the expression passed as the first argument is a TK_VECTOR, return ** a pointer to the i'th field of the vector. Or, if the first argument @@ -350,6 +351,7 @@ static Expr *exprVectorField(Expr *pVector, int i){ } return pVector; } +#endif /* ** If expression pExpr is of type TK_SELECT, generate code to evaluate @@ -361,9 +363,11 @@ static Expr *exprVectorField(Expr *pVector, int i){ */ static int exprCodeSubselect(Parse *pParse, Expr *pExpr){ int reg = 0; +#ifndef SQLITE_OMIT_SUBQUERY if( pExpr->op==TK_SELECT ){ reg = sqlite3CodeSubselect(pParse, pExpr, 0, 0); } +#endif return reg; } @@ -1829,6 +1833,7 @@ int sqlite3CodeOnce(Parse *pParse){ return sqlite3VdbeAddOp1(v, OP_Once, pParse->nOnce++); } +#ifndef SQLITE_OMIT_SUBQUERY /* ** Generate code that checks the left-most column of index table iCur to see if ** it contains any NULL entries. Cause the register at regHasNull to be set @@ -1844,6 +1849,7 @@ static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){ VdbeComment((v, "first_entry_in(%d)", iCur)); sqlite3VdbeJumpHere(v, addr1); } +#endif #ifndef SQLITE_OMIT_SUBQUERY @@ -2130,6 +2136,7 @@ int sqlite3FindInIndex( } #endif +#ifndef SQLITE_OMIT_SUBQUERY /* ** Argument pExpr is an (?, ?...) IN(...) expression. This ** function allocates and returns a nul-terminated string containing @@ -2161,6 +2168,7 @@ static char *exprINAffinity(Parse *pParse, Expr *pExpr){ } return zRet; } +#endif #ifndef SQLITE_OMIT_SUBQUERY /* diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 4c91d4657d..56da61a2aa 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -3944,7 +3944,6 @@ int sqlite3GetToken(const unsigned char *, int *); void sqlite3NestedParse(Parse*, const char*, ...); void sqlite3ExpirePreparedStatements(sqlite3*); int sqlite3CodeSubselect(Parse*, Expr *, int, int); -int sqlite3ExprCheckIN(Parse*, Expr*); void sqlite3SelectPrep(Parse*, Select*, NameContext*); void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p); int sqlite3MatchSpanName(const char*, const char*, const char*, const char*); @@ -3999,6 +3998,12 @@ Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int); void sqlite3BackupRestart(sqlite3_backup *); void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *); +#ifndef SQLITE_OMIT_SUBQUERY +int sqlite3ExprCheckIN(Parse*, Expr*); +#else +# define sqlite3ExprCheckIN(x,y) SQLITE_OK +#endif + #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 void sqlite3AnalyzeFunctions(void); int sqlite3Stat4ProbeSetValue(Parse*,Index*,UnpackedRecord**,Expr*,u8,int,int*); diff --git a/src/wherecode.c b/src/wherecode.c index 11e9bbda34..9aafa83665 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -360,6 +360,7 @@ static int codeEqualityTerm( assert( iTarget>0 ); if( pX->op==TK_EQ || pX->op==TK_IS ){ Expr *pRight = pX->pRight; +#ifndef SQLITE_OMIT_SUBQUERY if( pRight->op==TK_SELECT_COLUMN ){ /* This case occurs for expressions like "(a, b) == (SELECT ...)". */ WhereLoop *pLoop = pLevel->pWLoop; @@ -381,7 +382,9 @@ static int codeEqualityTerm( } } iReg = iTarget; - }else{ + }else +#endif + { iReg = sqlite3ExprCodeTarget(pParse, pRight, iTarget); } }else if( pX->op==TK_ISNULL ){ @@ -962,17 +965,20 @@ static void codeDeferredSeek( static void codeExprOrVector(Parse *pParse, Expr *p, int iReg, int nReg){ assert( nReg>0 ); if( sqlite3ExprIsVector(p) ){ - int i; - if( (p->flags & EP_xIsSelect)==0 ){ +#ifndef SQLITE_OMIT_SUBQUERY + if( (p->flags & EP_xIsSelect) ){ + Vdbe *v = pParse->pVdbe; + int iSelect = sqlite3CodeSubselect(pParse, p, 0, 0); + sqlite3VdbeAddOp3(v, OP_Copy, iSelect, iReg, nReg-1); + }else +#endif + { + int i; ExprList *pList = p->x.pList; assert( nReg<=pList->nExpr ); for(i=0; ia[i].pExpr, iReg+i); } - }else{ - Vdbe *v = pParse->pVdbe; - int iSelect = sqlite3CodeSubselect(pParse, p, 0, 0); - sqlite3VdbeAddOp3(v, OP_Copy, iSelect, iReg, nReg-1); } }else{ assert( nReg==1 );