SQLite

Check-in [f0d428d13a]
Login

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

Overview
Comment:Fix the CursorHint so that it includes the scan boundary constraints. On the expression text for the CursorHint opcode, show rowid correctly.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | cursor-hints
Files: files | file ages | folders
SHA1: f0d428d13a787251c2ca7685fec2a91b550eefba
User & Date: drh 2015-08-14 01:03:21.023
Context
2015-08-14
15:05
Refactor the sqlite3BtreeCursorHint() interface for improved maintainability. (check-in: fc3fb5cd0d user: drh tags: cursor-hints)
01:03
Fix the CursorHint so that it includes the scan boundary constraints. On the expression text for the CursorHint opcode, show rowid correctly. (check-in: f0d428d13a user: drh tags: cursor-hints)
2015-08-13
21:38
Fix a harmless compiler warning. (check-in: 608ab4ac19 user: drh tags: cursor-hints)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeaux.c.
1106
1107
1108
1109
1110
1111
1112



1113

1114
1115
1116
1117
1118
1119
1120

    case TK_REGISTER: {
      sqlite3_snprintf(nTemp, zTemp, "r[%d]", pExpr->iTable);
      break;
    }

    case TK_COLUMN: {



      sqlite3_snprintf(nTemp, zTemp, "c%d", (int)pExpr->iColumn);

      break;
    }

    case TK_LT:      zBinOp = "<";        break;
    case TK_LE:      zBinOp = "<=";       break;
    case TK_GT:      zBinOp = ">";        break;
    case TK_GE:      zBinOp = ">=";       break;







>
>
>
|
>







1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124

    case TK_REGISTER: {
      sqlite3_snprintf(nTemp, zTemp, "r[%d]", pExpr->iTable);
      break;
    }

    case TK_COLUMN: {
      if( pExpr->iColumn<0 ){
        sqlite3_snprintf(nTemp, zTemp, "rowid");
      }else{
        sqlite3_snprintf(nTemp, zTemp, "c%d", (int)pExpr->iColumn);
      }
      break;
    }

    case TK_LT:      zBinOp = "<";        break;
    case TK_LE:      zBinOp = "<=";       break;
    case TK_GT:      zBinOp = ">";        break;
    case TK_GE:      zBinOp = ">=";       break;
Changes to src/wherecode.c.
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
  pWC = &pWInfo->sWC;
  for(i=0; i<pWC->nTerm; i++){
    pTerm = &pWC->a[i];
    if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
    if( pTerm->prereqAll & pLevel->notReady ) continue;
    if( ExprHasProperty(pTerm->pExpr, EP_FromJoin) ) continue;
    if( sqlite3ExprContainsSubquery(pTerm->pExpr) ) continue;
    for(j=0; j<pWLoop->nLTerm && pWLoop->aLTerm[j]!=pTerm; j++){}
    if( j<pWLoop->nLTerm ) continue;
    pExpr = sqlite3ExprAnd(db, pExpr, sqlite3ExprDup(db, pTerm->pExpr, 0));
  }
  if( pExpr!=0 ){
    const char *a = (const char*)pExpr;
    Walker sWalker;
    memset(&sWalker, 0, sizeof(sWalker));
    sWalker.xExprCallback = codeCursorHintFixExpr;







<
<







648
649
650
651
652
653
654


655
656
657
658
659
660
661
  pWC = &pWInfo->sWC;
  for(i=0; i<pWC->nTerm; i++){
    pTerm = &pWC->a[i];
    if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
    if( pTerm->prereqAll & pLevel->notReady ) continue;
    if( ExprHasProperty(pTerm->pExpr, EP_FromJoin) ) continue;
    if( sqlite3ExprContainsSubquery(pTerm->pExpr) ) continue;


    pExpr = sqlite3ExprAnd(db, pExpr, sqlite3ExprDup(db, pTerm->pExpr, 0));
  }
  if( pExpr!=0 ){
    const char *a = (const char*)pExpr;
    Walker sWalker;
    memset(&sWalker, 0, sizeof(sWalker));
    sWalker.xExprCallback = codeCursorHintFixExpr;