/ 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 Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

505
506
507
508
509
510
511

512
513

514
515
516
517
518
519
520
  }
  if( pSort->sortFlags & SORTFLAG_UseSorter ){
    op = OP_SorterInsert;
  }else{
    op = OP_IdxInsert;
  }
  sqlite3VdbeAddOp2(v, op, pSort->iECursor, regRecord);

  sqlite3ReleaseTempReg(pParse, regRecord);
  sqlite3ReleaseTempRange(pParse, regBase, nExpr+2);

  if( pSelect->iLimit ){
    int addr1, addr2;
    int iLimit;
    if( pSelect->iOffset ){
      iLimit = pSelect->iOffset+1;
    }else{
      iLimit = pSelect->iLimit;







>
|
|
>







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