mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
The sqlite3WhereEnd() call now unwinds all Expr modifications made by the
sqlite3WhereBegin(). FossilOrigin-Name: 7bfd42f1dc0c94f9bb74516e62fec8e39c20f4749f4e0972f66c2886d3c64f73
This commit is contained in:
15
src/expr.c
15
src/expr.c
@@ -2933,8 +2933,6 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
|
||||
SelectDest dest; /* How to deal with SELECT result */
|
||||
int nReg; /* Registers to allocate */
|
||||
Expr *pLimit; /* New limit expression */
|
||||
Select *pCopy; /* Copy of pSel */
|
||||
int rc; /* return value from subroutine call */
|
||||
|
||||
Vdbe *v = pParse->pVdbe;
|
||||
assert( v!=0 );
|
||||
@@ -3018,16 +3016,9 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
|
||||
pSel->pLimit = sqlite3PExpr(pParse, TK_LIMIT, pLimit, 0);
|
||||
}
|
||||
pSel->iLimit = 0;
|
||||
|
||||
/* pSel might be reused. So generate code using a copy of pSel, so that
|
||||
** if the code generator modifies the underlying structure of the SELECT
|
||||
** (for example in whereIndexExprTrans()) the original in pSel will be
|
||||
** unchanged. */
|
||||
pCopy = sqlite3SelectDup(pParse->db, pSel, 0);
|
||||
rc = sqlite3Select(pParse, pCopy, &dest);
|
||||
sqlite3SelectDelete(pParse->db, pCopy);
|
||||
if( rc ) return 0;
|
||||
|
||||
if( sqlite3Select(pParse, pSel, &dest) ){
|
||||
return 0;
|
||||
}
|
||||
pExpr->iTable = rReg = dest.iSDParm;
|
||||
ExprSetVVAProperty(pExpr, EP_NoReduce);
|
||||
if( addrOnce ){
|
||||
|
||||
Reference in New Issue
Block a user