aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-07-08 23:40:20 +0000
committerdrh <drh@noemail.net>2008-07-08 23:40:20 +0000
commita9671a22b370710dfc89c0220cf02a1967ac869f (patch)
treefbbb23b5a85f4d24e2a37c405f112f02258eadb3 /src
parent96d9cf064b9024abc1c4e4da79992ff8e618347f (diff)
downloadsqlite-a9671a22b370710dfc89c0220cf02a1967ac869f.tar.gz
sqlite-a9671a22b370710dfc89c0220cf02a1967ac869f.zip
Remove obsolete code from select.c, including the "affinity" parameter
to the sqlite3Select() module. (CVS 5380) FossilOrigin-Name: cbd3c1585b7a8f8042aa1448fe1be87de056c41a
Diffstat (limited to 'src')
-rw-r--r--src/build.c4
-rw-r--r--src/delete.c4
-rw-r--r--src/expr.c6
-rw-r--r--src/insert.c4
-rw-r--r--src/parse.y4
-rw-r--r--src/select.c210
-rw-r--r--src/sqliteInt.h4
-rw-r--r--src/test_config.c4
-rw-r--r--src/trigger.c4
-rw-r--r--src/update.c4
10 files changed, 82 insertions, 166 deletions
diff --git a/src/build.c b/src/build.c
index 926015fe9..8a1d4bb75 100644
--- a/src/build.c
+++ b/src/build.c
@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.489 2008/07/08 22:28:49 shane Exp $
+** $Id: build.c,v 1.490 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1526,7 +1526,7 @@ void sqlite3EndTable(
sqlite3VdbeChangeP5(v, 1);
pParse->nTab = 2;
sqlite3SelectDestInit(&dest, SRT_Table, 1);
- sqlite3Select(pParse, pSelect, &dest, 0, 0, 0, 0);
+ sqlite3Select(pParse, pSelect, &dest, 0, 0, 0);
sqlite3VdbeAddOp1(v, OP_Close, 1);
if( pParse->nErr==0 ){
pSelTab = sqlite3ResultSetOfSelect(pParse, 0, pSelect);
diff --git a/src/delete.c b/src/delete.c
index 61b3f8b45..654570bc5 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
-** $Id: delete.c,v 1.169 2008/04/28 18:46:43 drh Exp $
+** $Id: delete.c,v 1.170 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
@@ -106,7 +106,7 @@ void sqlite3MaterializeView(
pDup = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0);
}
sqlite3SelectDestInit(&dest, SRT_EphemTab, iCur);
- sqlite3Select(pParse, pDup, &dest, 0, 0, 0, 0);
+ sqlite3Select(pParse, pDup, &dest, 0, 0, 0);
sqlite3SelectDelete(pDup);
}
#endif /* !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER) */
diff --git a/src/expr.c b/src/expr.c
index b2aca6bf9..1929eb7d2 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.383 2008/07/04 09:41:39 danielk1977 Exp $
+** $Id: expr.c,v 1.384 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1888,7 +1888,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr, int rMayHaveNull){
sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable);
dest.affinity = (int)affinity;
assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable );
- if( sqlite3Select(pParse, pExpr->pSelect, &dest, 0, 0, 0, 0) ){
+ if( sqlite3Select(pParse, pExpr->pSelect, &dest, 0, 0, 0) ){
return;
}
pEList = pExpr->pSelect->pEList;
@@ -1969,7 +1969,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr, int rMayHaveNull){
}
sqlite3ExprDelete(pSel->pLimit);
pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one);
- if( sqlite3Select(pParse, pSel, &dest, 0, 0, 0, 0) ){
+ if( sqlite3Select(pParse, pSel, &dest, 0, 0, 0) ){
return;
}
pExpr->iColumn = dest.iParm;
diff --git a/src/insert.c b/src/insert.c
index 586775e5c..9dda3954f 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
-** $Id: insert.c,v 1.246 2008/07/08 22:28:49 shane Exp $
+** $Id: insert.c,v 1.247 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
@@ -530,7 +530,7 @@ void sqlite3Insert(
VdbeComment((v, "Jump over SELECT coroutine"));
/* Resolve the expressions in the SELECT statement and execute it. */
- rc = sqlite3Select(pParse, pSelect, &dest, 0, 0, 0, 0);
+ rc = sqlite3Select(pParse, pSelect, &dest, 0, 0, 0);
if( rc || pParse->nErr || db->mallocFailed ){
goto insert_cleanup;
}
diff --git a/src/parse.y b/src/parse.y
index 914cad15d..65c174719 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
-** @(#) $Id: parse.y,v 1.244 2008/06/05 16:47:39 danielk1977 Exp $
+** @(#) $Id: parse.y,v 1.245 2008/07/08 23:40:20 drh Exp $
*/
// All token codes are small integers with #defines that begin with "TK_"
@@ -361,7 +361,7 @@ cmd ::= DROP VIEW ifexists(E) fullname(X). {
//
cmd ::= select(X). {
SelectDest dest = {SRT_Callback, 0, 0, 0, 0};
- sqlite3Select(pParse, X, &dest, 0, 0, 0, 0);
+ sqlite3Select(pParse, X, &dest, 0, 0, 0);
sqlite3SelectDelete(X);
}
diff --git a/src/select.c b/src/select.c
index f7c5780ad..7bd7c59e9 100644
--- a/src/select.c
+++ b/src/select.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.450 2008/07/08 19:34:07 drh Exp $
+** $Id: select.c,v 1.451 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
@@ -160,12 +160,11 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
(jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) ||
(jointype & JT_ERROR)!=0
){
- const char *zSp1 = " ";
- const char *zSp2 = " ";
- if( pB==0 ){ zSp1++; }
- if( pC==0 ){ zSp2++; }
+ const char *zSp = " ";
+ assert( pB!=0 );
+ if( pC==0 ){ zSp++; }
sqlite3ErrorMsg(pParse, "unknown or unsupported join type: "
- "%T%s%T%s%T", pA, zSp1, pB, zSp2, pC);
+ "%T %T%s%T", pA, pB, zSp, pC);
jointype = JT_INNER;
}else if( jointype & JT_RIGHT ){
sqlite3ErrorMsg(pParse,
@@ -531,8 +530,7 @@ static void selectInnerLoop(
int distinct, /* If >=0, make sure results are distinct */
SelectDest *pDest, /* How to dispose of the results */
int iContinue, /* Jump here to continue with next row */
- int iBreak, /* Jump here to break out of the inner loop */
- char *aff /* affinity string if eDest is SRT_Union */
+ int iBreak /* Jump here to break out of the inner loop */
){
Vdbe *v = pParse->pVdbe;
int i;
@@ -609,9 +607,6 @@ static void selectInnerLoop(
int r1;
r1 = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nColumn, r1);
- if( aff ){
- sqlite3VdbeChangeP4(v, -1, aff, P4_STATIC);
- }
sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm, r1);
sqlite3ReleaseTempReg(pParse, r1);
break;
@@ -849,7 +844,7 @@ static void generateSortTail(
if( eDest==SRT_Callback ){
sqlite3VdbeAddOp2(v, OP_ResultRow, pDest->iMem, nColumn);
sqlite3ExprCacheAffinityChange(pParse, pDest->iMem, nColumn);
- }else if( eDest==SRT_Coroutine ){
+ }else{
sqlite3VdbeAddOp1(v, OP_Yield, pDest->iParm);
}
break;
@@ -862,12 +857,9 @@ static void generateSortTail(
sqlite3ReleaseTempReg(pParse, regRow);
sqlite3ReleaseTempReg(pParse, regRowid);
- /* Jump to the end of the loop when the LIMIT is reached
+ /* LIMIT has been implemented by the pushOntoSorter() routine.
*/
- if( p->iLimit ){
- sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1);
- sqlite3VdbeAddOp2(v, OP_IfZero, p->iLimit, brk);
- }
+ assert( p->iLimit==0 );
/* The bottom of the loop
*/
@@ -1825,21 +1817,6 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){
}
}
-/*
-** Allocate a virtual index to use for sorting.
-*/
-static void createSortingIndex(Parse *pParse, Select *p, ExprList *pOrderBy){
- if( pOrderBy ){
- int addr;
- assert( pOrderBy->iECursor==0 );
- pOrderBy->iECursor = pParse->nTab++;
- addr = sqlite3VdbeAddOp2(pParse->pVdbe, OP_OpenEphemeral,
- pOrderBy->iECursor, pOrderBy->nExpr+1);
- assert( p->addrOpenEphm[2] == -1 );
- p->addrOpenEphm[2] = addr;
- }
-}
-
#ifndef SQLITE_OMIT_COMPOUND_SELECT
/*
** Return the appropriate collating sequence for the iCol-th column of
@@ -1867,8 +1844,7 @@ static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){
static int multiSelectOrderBy(
Parse *pParse, /* Parsing context */
Select *p, /* The right-most of SELECTs to be coded */
- SelectDest *pDest, /* What to do with query results */
- char *aff /* If eDest is SRT_Union, the affinity string */
+ SelectDest *pDest /* What to do with query results */
);
@@ -1907,14 +1883,12 @@ static int multiSelectOrderBy(
static int multiSelect(
Parse *pParse, /* Parsing context */
Select *p, /* The right-most of SELECTs to be coded */
- SelectDest *pDest, /* What to do with query results */
- char *aff /* If eDest is SRT_Union, the affinity string */
+ SelectDest *pDest /* What to do with query results */
){
int rc = SQLITE_OK; /* Success code from a subroutine */
Select *pPrior; /* Another SELECT immediately to our left */
Vdbe *v; /* Generate code to this VDBE */
int nCol; /* Number of columns in the result set */
- ExprList *pOrderBy; /* The ORDER BY clause on p */
int aSetP2[2]; /* Set P2 value of these op to number of columns */
int nSetP2 = 0; /* Number of slots in aSetP2[] used */
SelectDest dest; /* Alternative data destination */
@@ -1971,47 +1945,43 @@ static int multiSelect(
goto multi_select_end;
}
-#if 1
+ /* Compound SELECTs that have an ORDER BY clause are handled separately.
+ */
if( p->pOrderBy ){
- return multiSelectOrderBy(pParse, p, pDest, aff);
+ return multiSelectOrderBy(pParse, p, pDest);
}
-#endif
/* Generate code for the left and right SELECT statements.
*/
- pOrderBy = p->pOrderBy;
switch( p->op ){
case TK_ALL: {
- if( pOrderBy==0 ){
- int addr = 0;
- assert( !pPrior->pLimit );
- pPrior->pLimit = p->pLimit;
- pPrior->pOffset = p->pOffset;
- rc = sqlite3Select(pParse, pPrior, &dest, 0, 0, 0, aff);
- p->pLimit = 0;
- p->pOffset = 0;
- if( rc ){
- goto multi_select_end;
- }
- p->pPrior = 0;
- p->iLimit = pPrior->iLimit;
- p->iOffset = pPrior->iOffset;
- if( p->iLimit ){
- addr = sqlite3VdbeAddOp1(v, OP_IfZero, p->iLimit);
- VdbeComment((v, "Jump ahead if LIMIT reached"));
- }
- rc = sqlite3Select(pParse, p, &dest, 0, 0, 0, aff);
- pDelete = p->pPrior;
- p->pPrior = pPrior;
- if( rc ){
- goto multi_select_end;
- }
- if( addr ){
- sqlite3VdbeJumpHere(v, addr);
- }
- break;
+ int addr = 0;
+ assert( !pPrior->pLimit );
+ pPrior->pLimit = p->pLimit;
+ pPrior->pOffset = p->pOffset;
+ rc = sqlite3Select(pParse, pPrior, &dest, 0, 0, 0);
+ p->pLimit = 0;
+ p->pOffset = 0;
+ if( rc ){
+ goto multi_select_end;
+ }
+ p->pPrior = 0;
+ p->iLimit = pPrior->iLimit;
+ p->iOffset = pPrior->iOffset;
+ if( p->iLimit ){
+ addr = sqlite3VdbeAddOp1(v, OP_IfZero, p->iLimit);
+ VdbeComment((v, "Jump ahead if LIMIT reached"));
+ }
+ rc = sqlite3Select(pParse, p, &dest, 0, 0, 0);
+ pDelete = p->pPrior;
+ p->pPrior = pPrior;
+ if( rc ){
+ goto multi_select_end;
+ }
+ if( addr ){
+ sqlite3VdbeJumpHere(v, addr);
}
- /* For UNION ALL ... ORDER BY fall through to the next case */
+ break;
}
case TK_EXCEPT:
case TK_UNION: {
@@ -2023,7 +1993,7 @@ static int multiSelect(
SelectDest uniondest;
priorOp = p->op==TK_ALL ? SRT_Table : SRT_Union;
- if( dest.eDest==priorOp && pOrderBy==0 && !p->pLimit && !p->pOffset ){
+ if( dest.eDest==priorOp && !p->pLimit && !p->pOffset ){
/* We can reuse a temporary table generated by a SELECT to our
** right.
*/
@@ -2046,7 +2016,6 @@ static int multiSelect(
p->addrOpenEphm[0] = addr;
p->pRightmost->usesEphm = 1;
}
- createSortingIndex(pParse, p, pOrderBy);
assert( p->pEList );
}
@@ -2054,7 +2023,7 @@ static int multiSelect(
*/
assert( !pPrior->pOrderBy );
sqlite3SelectDestInit(&uniondest, priorOp, unionTab);
- rc = sqlite3Select(pParse, pPrior, &uniondest, 0, 0, 0, aff);
+ rc = sqlite3Select(pParse, pPrior, &uniondest, 0, 0, 0);
if( rc ){
goto multi_select_end;
}
@@ -2067,20 +2036,19 @@ static int multiSelect(
case TK_ALL: op = SRT_Table; break;
}
p->pPrior = 0;
- p->pOrderBy = 0;
- p->disallowOrderBy = pOrderBy!=0;
+ p->disallowOrderBy = 0;
pLimit = p->pLimit;
p->pLimit = 0;
pOffset = p->pOffset;
p->pOffset = 0;
uniondest.eDest = op;
- rc = sqlite3Select(pParse, p, &uniondest, 0, 0, 0, aff);
+ rc = sqlite3Select(pParse, p, &uniondest, 0, 0, 0);
/* Query flattening in sqlite3Select() might refill p->pOrderBy.
** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */
sqlite3ExprListDelete(p->pOrderBy);
pDelete = p->pPrior;
p->pPrior = pPrior;
- p->pOrderBy = pOrderBy;
+ p->pOrderBy = 0;
sqlite3ExprDelete(p->pLimit);
p->pLimit = pLimit;
p->pOffset = pOffset;
@@ -2108,7 +2076,7 @@ static int multiSelect(
sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak);
iStart = sqlite3VdbeCurrentAddr(v);
selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr,
- pOrderBy, -1, &dest, iCont, iBreak, 0);
+ 0, -1, &dest, iCont, iBreak);
sqlite3VdbeResolveLabel(v, iCont);
sqlite3VdbeAddOp2(v, OP_Next, unionTab, iStart);
sqlite3VdbeResolveLabel(v, iBreak);
@@ -2134,7 +2102,6 @@ static int multiSelect(
rc = 1;
goto multi_select_end;
}
- createSortingIndex(pParse, p, pOrderBy);
addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tab1, 0);
assert( p->addrOpenEphm[0] == -1 );
@@ -2145,7 +2112,7 @@ static int multiSelect(
/* Code the SELECTs to our left into temporary table "tab1".
*/
sqlite3SelectDestInit(&intersectdest, SRT_Union, tab1);
- rc = sqlite3Select(pParse, pPrior, &intersectdest, 0, 0, 0, aff);
+ rc = sqlite3Select(pParse, pPrior, &intersectdest, 0, 0, 0);
if( rc ){
goto multi_select_end;
}
@@ -2161,7 +2128,7 @@ static int multiSelect(
pOffset = p->pOffset;
p->pOffset = 0;
intersectdest.iParm = tab2;
- rc = sqlite3Select(pParse, p, &intersectdest, 0, 0, 0, aff);
+ rc = sqlite3Select(pParse, p, &intersectdest, 0, 0, 0);
pDelete = p->pPrior;
p->pPrior = pPrior;
sqlite3ExprDelete(p->pLimit);
@@ -2189,7 +2156,7 @@ static int multiSelect(
sqlite3VdbeAddOp3(v, OP_NotFound, tab2, iCont, r1);
sqlite3ReleaseTempReg(pParse, r1);
selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr,
- pOrderBy, -1, &dest, iCont, iBreak, 0);
+ 0, -1, &dest, iCont, iBreak);
sqlite3VdbeResolveLabel(v, iCont);
sqlite3VdbeAddOp2(v, OP_Next, tab1, iStart);
sqlite3VdbeResolveLabel(v, iBreak);
@@ -2206,28 +2173,24 @@ static int multiSelect(
sqlite3VdbeChangeP2(v, aSetP2[--nSetP2], nCol);
}
- /* Compute collating sequences used by either the ORDER BY clause or
- ** by any temporary tables needed to implement the compound select.
- ** Attach the KeyInfo structure to all temporary tables. Invoke the
- ** ORDER BY processing if there is an ORDER BY clause.
+ /* Compute collating sequences used by
+ ** temporary tables needed to implement the compound select.
+ ** Attach the KeyInfo structure to all temporary tables.
**
** This section is run by the right-most SELECT statement only.
** SELECT statements to the left always skip this part. The right-most
** SELECT might also skip this part if it has no ORDER BY clause and
** no temp tables are required.
*/
- if( pOrderBy || p->usesEphm ){
+ if( p->usesEphm ){
int i; /* Loop counter */
KeyInfo *pKeyInfo; /* Collating sequence for the result set */
Select *pLoop; /* For looping through SELECT statements */
- int nKeyCol; /* Number of entries in pKeyInfo->aCol[] */
CollSeq **apColl; /* For looping through pKeyInfo->aColl[] */
- CollSeq **aCopy; /* A copy of pKeyInfo->aColl[] */
assert( p->pRightmost==p );
- nKeyCol = nCol + (pOrderBy ? pOrderBy->nExpr : 0);
pKeyInfo = sqlite3DbMallocZero(pParse->db,
- sizeof(*pKeyInfo)+nKeyCol*(sizeof(CollSeq*) + 1));
+ sizeof(*pKeyInfo)+nCol*(sizeof(CollSeq*) + 1));
if( !pKeyInfo ){
rc = SQLITE_NOMEM;
goto multi_select_end;
@@ -2257,51 +2220,6 @@ static int multiSelect(
pLoop->addrOpenEphm[i] = -1;
}
}
-
- if( pOrderBy ){
- struct ExprList_item *pOTerm = pOrderBy->a;
- int nOrderByExpr = pOrderBy->nExpr;
- int addr;
- u8 *pSortOrder;
-
- /* Reuse the same pKeyInfo for the ORDER BY as was used above for
- ** the compound select statements. Except we have to change out the
- ** pKeyInfo->aColl[] values. Some of the aColl[] values will be
- ** reused when constructing the pKeyInfo for the ORDER BY, so make
- ** a copy. Sufficient space to hold both the nCol entries for
- ** the compound select and the nOrderbyExpr entries for the ORDER BY
- ** was allocated above. But we need to move the compound select
- ** entries out of the way before constructing the ORDER BY entries.
- ** Move the compound select entries into aCopy[] where they can be
- ** accessed and reused when constructing the ORDER BY entries.
- ** Because nCol might be greater than or less than nOrderByExpr
- ** we have to use memmove() when doing the copy.
- */
- aCopy = &pKeyInfo->aColl[nOrderByExpr];
- pSortOrder = pKeyInfo->aSortOrder = (u8*)&aCopy[nCol];
- memmove(aCopy, pKeyInfo->aColl, nCol*sizeof(CollSeq*));
-
- apColl = pKeyInfo->aColl;
- for(i=0; i<nOrderByExpr; i++, pOTerm++, apColl++, pSortOrder++){
- Expr *pExpr = pOTerm->pExpr;
- if( (pExpr->flags & EP_ExpCollate) ){
- assert( pExpr->pColl!=0 );
- *apColl = pExpr->pColl;
- }else{
- *apColl = aCopy[pExpr->iColumn];
- }
- *pSortOrder = pOTerm->sortOrder;
- }
- assert( p->pRightmost==p );
- assert( p->addrOpenEphm[2]>=0 );
- addr = p->addrOpenEphm[2];
- sqlite3VdbeChangeP2(v, addr, p->pOrderBy->nExpr+2);
- pKeyInfo->nField = nOrderByExpr;
- sqlite3VdbeChangeP4(v, addr, (char*)pKeyInfo, P4_KEYINFO_HANDOFF);
- pKeyInfo = 0;
- generateSortTail(pParse, p, v, p->pEList->nExpr, &dest);
- }
-
sqlite3_free(pKeyInfo);
}
@@ -2558,8 +2476,7 @@ static int generateOutputSubroutine(
static int multiSelectOrderBy(
Parse *pParse, /* Parsing context */
Select *p, /* The right-most of SELECTs to be coded */
- SelectDest *pDest, /* What to do with query results */
- char *aff /* If eDest is SRT_Union, the affinity string */
+ SelectDest *pDest /* What to do with query results */
){
int i, j; /* Loop counters */
Select *pPrior; /* Another SELECT immediately to our left */
@@ -2758,7 +2675,7 @@ static int multiSelectOrderBy(
*/
VdbeNoopComment((v, "Begin coroutine for left SELECT"));
pPrior->iLimit = regLimitA;
- sqlite3Select(pParse, pPrior, &destA, 0, 0, 0, 0);
+ sqlite3Select(pParse, pPrior, &destA, 0, 0, 0);
sqlite3VdbeAddOp2(v, OP_Integer, 1, regEofA);
sqlite3VdbeAddOp1(v, OP_Yield, regAddrA);
VdbeNoopComment((v, "End coroutine for left SELECT"));
@@ -2772,7 +2689,7 @@ static int multiSelectOrderBy(
savedOffset = p->iOffset;
p->iLimit = regLimitB;
p->iOffset = 0;
- sqlite3Select(pParse, p, &destB, 0, 0, 0, 0);
+ sqlite3Select(pParse, p, &destB, 0, 0, 0);
p->iLimit = savedLimit;
p->iOffset = savedOffset;
sqlite3VdbeAddOp2(v, OP_Integer, 1, regEofB);
@@ -3731,8 +3648,7 @@ int sqlite3Select(
SelectDest *pDest, /* What to do with the query results */
Select *pParent, /* Another SELECT for which this is a sub-query */
int parentTab, /* Index in pParent->pSrc of this query */
- int *pParentAgg, /* True if pParent uses aggregate functions */
- char *aff /* If eDest is SRT_Union, the affinity string */
+ int *pParentAgg /* True if pParent uses aggregate functions */
){
int i, j; /* Loop counters */
WhereInfo *pWInfo; /* Return from sqlite3WhereBegin() */
@@ -3839,7 +3755,7 @@ int sqlite3Select(
i = -1;
}else{
sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
- sqlite3Select(pParse, pSub, &dest, p, i, &isAgg, 0);
+ sqlite3Select(pParse, pSub, &dest, p, i, &isAgg);
}
if( pParse->nErr || db->mallocFailed ){
goto select_end;
@@ -3876,7 +3792,7 @@ int sqlite3Select(
return 1;
}
}
- return multiSelect(pParse, p, pDest, aff);
+ return multiSelect(pParse, p, pDest);
}
#endif
@@ -3963,7 +3879,7 @@ int sqlite3Select(
*/
assert(!isDistinct);
selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, -1, pDest,
- pWInfo->iContinue, pWInfo->iBreak, aff);
+ pWInfo->iContinue, pWInfo->iBreak);
/* End the database scan loop.
*/
@@ -4073,7 +3989,7 @@ int sqlite3Select(
}
selectInnerLoop(pParse, p, p->pEList, 0, 0, pOrderBy,
distinct, pDest,
- addrOutputRow+1, addrSetAbort, aff);
+ addrOutputRow+1, addrSetAbort);
sqlite3VdbeAddOp1(v, OP_Return, regOutputRow);
VdbeComment((v, "end groupby result generator"));
@@ -4268,7 +4184,7 @@ int sqlite3Select(
sqlite3ExprIfFalse(pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL);
}
selectInnerLoop(pParse, p, p->pEList, 0, 0, 0, -1,
- pDest, addrEnd, addrEnd, aff);
+ pDest, addrEnd, addrEnd);
sqlite3ExprListDelete(pDel);
}
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 103fd04fe..3b22e94ca 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.737 2008/07/08 22:28:49 shane Exp $
+** @(#) $Id: sqliteInt.h,v 1.738 2008/07/08 23:40:20 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -1922,7 +1922,7 @@ void sqlite3SrcListDelete(SrcList*);
void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
Token*, int, int);
void sqlite3DropIndex(Parse*, SrcList*, int);
-int sqlite3Select(Parse*, Select*, SelectDest*, Select*, int, int*, char *aff);
+int sqlite3Select(Parse*, Select*, SelectDest*, Select*, int, int*);
Select *sqlite3SelectNew(Parse*,ExprList*,SrcList*,Expr*,ExprList*,
Expr*,ExprList*,int,Expr*,Expr*);
void sqlite3SelectDelete(Select*);
diff --git a/src/test_config.c b/src/test_config.c
index 35ca0c188..b62f8c01b 100644
--- a/src/test_config.c
+++ b/src/test_config.c
@@ -16,7 +16,7 @@
** The focus of this file is providing the TCL testing layer
** access to compile-time constants.
**
-** $Id: test_config.c,v 1.30 2008/06/26 10:54:12 danielk1977 Exp $
+** $Id: test_config.c,v 1.31 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteLimit.h"
@@ -64,7 +64,7 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY);
#endif
-#ifdef SQLITE_MEMDEBUG
+#if 1 /* def SQLITE_MEMDEBUG */
Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY);
diff --git a/src/trigger.c b/src/trigger.c
index 36e82aeb3..ccee82917 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -10,7 +10,7 @@
*************************************************************************
**
**
-** $Id: trigger.c,v 1.126 2008/05/16 04:51:55 danielk1977 Exp $
+** $Id: trigger.c,v 1.127 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
@@ -680,7 +680,7 @@ static int codeTriggerProgram(
sqlite3SelectDestInit(&dest, SRT_Discard, 0);
sqlite3SelectResolve(pParse, ss, 0);
- sqlite3Select(pParse, ss, &dest, 0, 0, 0, 0);
+ sqlite3Select(pParse, ss, &dest, 0, 0, 0);
sqlite3SelectDelete(ss);
}
break;
diff --git a/src/update.c b/src/update.c
index 5ce03bf40..22d301240 100644
--- a/src/update.c
+++ b/src/update.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
-** $Id: update.c,v 1.178 2008/04/28 18:46:43 drh Exp $
+** $Id: update.c,v 1.179 2008/07/08 23:40:20 drh Exp $
*/
#include "sqliteInt.h"
@@ -649,7 +649,7 @@ static void updateVirtualTable(
/* fill the ephemeral table
*/
sqlite3SelectDestInit(&dest, SRT_Table, ephemTab);
- sqlite3Select(pParse, pSelect, &dest, 0, 0, 0, 0);
+ sqlite3Select(pParse, pSelect, &dest, 0, 0, 0);
/* Generate code to scan the ephemeral table and call VUpdate. */
iReg = ++pParse->nMem;