diff options
author | danielk1977 <danielk1977@noemail.net> | 2008-01-02 16:27:09 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2008-01-02 16:27:09 +0000 |
commit | 6c8c8ce0e2f8d1d434c9d05baf2741bc025e53d2 (patch) | |
tree | b41bfa32fe566814cb0537ee2b2084eb56efe893 /src/expr.c | |
parent | a2a49dc9dfb6a341680d2d528a9567ea1f666569 (diff) | |
download | sqlite-6c8c8ce0e2f8d1d434c9d05baf2741bc025e53d2.tar.gz sqlite-6c8c8ce0e2f8d1d434c9d05baf2741bc025e53d2.zip |
Combine the eDest and iParm arguments to sqlite3Select() into a single type - "SelectDest". (CVS 4657)
FossilOrigin-Name: 86dcdfe6d7d629618ccb3c3ff0ca09f2da2d06c7
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/expr.c b/src/expr.c index c5e3a8fbd..181e23c61 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.323 2008/01/02 14:28:13 drh Exp $ +** $Id: expr.c,v 1.324 2008/01/02 16:27:10 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1738,10 +1738,12 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ ** Generate code to write the results of the select into the temporary ** table allocated and opened above. */ - int iParm = pExpr->iTable + (((int)affinity)<<16); + SelectDest dest = {SRT_Set, 0, 0}; + dest.iParm = pExpr->iTable; + dest.affinity = (int)affinity; ExprList *pEList; assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); - if( sqlite3Select(pParse, pExpr->pSelect, SRT_Set, iParm, 0, 0, 0, 0) ){ + if( sqlite3Select(pParse, pExpr->pSelect, &dest, 0, 0, 0, 0) ){ return; } pEList = pExpr->pSelect->pEList; @@ -1798,26 +1800,25 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ */ static const Token one = { (u8*)"1", 0, 1 }; Select *pSel; - int sop; - int iMem; + SelectDest dest; pSel = pExpr->pSelect; - iMem = pParse->nMem++; + dest.iParm = pParse->nMem++; if( pExpr->op==TK_SELECT ){ - sop = SRT_Mem; - sqlite3VdbeAddOp(v, OP_MemNull, 0, iMem); + dest.eDest = SRT_Mem; + sqlite3VdbeAddOp(v, OP_MemNull, 0, dest.iParm); VdbeComment((v, "Init subquery result")); }else{ - sop = SRT_Exists; - sqlite3VdbeAddOp(v, OP_MemInt, 0, iMem); + dest.eDest = SRT_Exists; + sqlite3VdbeAddOp(v, OP_MemInt, 0, dest.iParm); VdbeComment((v, "Init EXISTS result")); } sqlite3ExprDelete(pSel->pLimit); pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one); - if( sqlite3Select(pParse, pSel, sop, iMem, 0, 0, 0, 0) ){ + if( sqlite3Select(pParse, pSel, &dest, 0, 0, 0, 0) ){ return; } - pExpr->iColumn = iMem; + pExpr->iColumn = dest.iParm; break; } } |