1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Cherrypick the [7e5b56b1c6] fix for the sqlite3SelectDup() routine

into trunk.

FossilOrigin-Name: 7fc535090ca3416706dff4abce10ac2d7f775e02
This commit is contained in:
drh
2011-12-07 01:55:51 +00:00
parent ed51f29774
commit 23b1b37229
3 changed files with 12 additions and 10 deletions

View File

@@ -940,7 +940,7 @@ IdList *sqlite3IdListDup(sqlite3 *db, IdList *p){
return pNew;
}
Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
Select *pNew;
Select *pNew, *pPrior;
if( p==0 ) return 0;
pNew = sqlite3DbMallocRaw(db, sizeof(*p) );
if( pNew==0 ) return 0;
@@ -951,7 +951,9 @@ Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
pNew->pHaving = sqlite3ExprDup(db, p->pHaving, flags);
pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, flags);
pNew->op = p->op;
pNew->pPrior = sqlite3SelectDup(db, p->pPrior, flags);
pNew->pPrior = pPrior = sqlite3SelectDup(db, p->pPrior, flags);
if( pPrior ) pPrior->pNext = pNew;
pNew->pNext = 0;
pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags);
pNew->pOffset = sqlite3ExprDup(db, p->pOffset, flags);
pNew->iLimit = 0;