/ Check-in [463d921b]
Login

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

Overview
Comment:Avoid reusing temporary registers in co-routines when doing block-sorting.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | orderby-planning
Files: files | file ages | folders
SHA1:463d921b519b08648a715e987c430f06b06bae84
User & Date: drh 2014-03-19 15:17:24
Context
2014-03-19
16:56
Fix a problem in the block-sort logic that can arise if the VDBE opcode array is resized while the block-sort logic is being coded. "make test" now runs to completion, though there are still 17 failures. check-in: 62f3a220 user: drh tags: orderby-planning
15:17
Avoid reusing temporary registers in co-routines when doing block-sorting. check-in: 463d921b user: drh tags: orderby-planning
14:30
Make sure the where.c query planner never reports that the number of ORDER BY terms that are satisfied by indices is negative. check-in: b186d8d1 user: drh tags: orderby-planning
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

   505    505     }
   506    506     if( pSort->sortFlags & SORTFLAG_UseSorter ){
   507    507       op = OP_SorterInsert;
   508    508     }else{
   509    509       op = OP_IdxInsert;
   510    510     }
   511    511     sqlite3VdbeAddOp2(v, op, pSort->iECursor, regRecord);
   512         -  sqlite3ReleaseTempReg(pParse, regRecord);
   513         -  sqlite3ReleaseTempRange(pParse, regBase, nExpr+2);
          512  +  if( nOBSat==0 ){
          513  +    sqlite3ReleaseTempReg(pParse, regRecord);
          514  +    sqlite3ReleaseTempRange(pParse, regBase, nExpr+2);
          515  +  }
   514    516     if( pSelect->iLimit ){
   515    517       int addr1, addr2;
   516    518       int iLimit;
   517    519       if( pSelect->iOffset ){
   518    520         iLimit = pSelect->iOffset+1;
   519    521       }else{
   520    522         iLimit = pSelect->iLimit;