/ Check-in [7fc53509]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cherrypick the [7e5b56b1c6] fix for the sqlite3SelectDup() routine into trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7fc535090ca3416706dff4abce10ac2d7f775e02
User & Date: drh 2011-12-07 01:55:51
Context
2011-12-08
03:51
Follow the previously established pattern for detecting preprocessor defines for specific flavors of Windows (for NT in this case). check-in: a0d92193 user: mistachkin tags: trunk
2011-12-07
01:55
Cherrypick the [7e5b56b1c6] fix for the sqlite3SelectDup() routine into trunk. check-in: 7fc53509 user: drh tags: trunk
2011-12-06
13:46
Add file tkt-3a77c9714e.test, containing tests to verify that the problem documented by ticket [3a77c9714e] has been fixed. check-in: 162421da user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   936    936       struct IdList_item *pOldItem = &p->a[i];
   937    937       pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
   938    938       pNewItem->idx = pOldItem->idx;
   939    939     }
   940    940     return pNew;
   941    941   }
   942    942   Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
   943         -  Select *pNew;
          943  +  Select *pNew, *pPrior;
   944    944     if( p==0 ) return 0;
   945    945     pNew = sqlite3DbMallocRaw(db, sizeof(*p) );
   946    946     if( pNew==0 ) return 0;
   947    947     pNew->pEList = sqlite3ExprListDup(db, p->pEList, flags);
   948    948     pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
   949    949     pNew->pWhere = sqlite3ExprDup(db, p->pWhere, flags);
   950    950     pNew->pGroupBy = sqlite3ExprListDup(db, p->pGroupBy, flags);
   951    951     pNew->pHaving = sqlite3ExprDup(db, p->pHaving, flags);
   952    952     pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, flags);
   953    953     pNew->op = p->op;
   954         -  pNew->pPrior = sqlite3SelectDup(db, p->pPrior, flags);
          954  +  pNew->pPrior = pPrior = sqlite3SelectDup(db, p->pPrior, flags);
          955  +  if( pPrior ) pPrior->pNext = pNew;
          956  +  pNew->pNext = 0;
   955    957     pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags);
   956    958     pNew->pOffset = sqlite3ExprDup(db, p->pOffset, flags);
   957    959     pNew->iLimit = 0;
   958    960     pNew->iOffset = 0;
   959    961     pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
   960    962     pNew->pRightmost = 0;
   961    963     pNew->addrOpenEphm[0] = -1;