/ Check-in [f0d428d1]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 | SQL archive
Timelines: family | ancestors | descendants | both | cursor-hints
Files: files | file ages | folders
SHA1: f0d428d13a787251c2ca7685fec2a91b550eefba
User & Date: drh 2015-08-14 01:03:21
Context
2015-08-14
15:05
Refactor the sqlite3BtreeCursorHint() interface for improved maintainability. check-in: fc3fb5cd 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: f0d428d1 user: drh tags: cursor-hints
2015-08-13
21:38
Fix a harmless compiler warning. check-in: 608ab4ac user: drh tags: cursor-hints
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  1106   1106   
  1107   1107       case TK_REGISTER: {
  1108   1108         sqlite3_snprintf(nTemp, zTemp, "r[%d]", pExpr->iTable);
  1109   1109         break;
  1110   1110       }
  1111   1111   
  1112   1112       case TK_COLUMN: {
  1113         -      sqlite3_snprintf(nTemp, zTemp, "c%d", (int)pExpr->iColumn);
         1113  +      if( pExpr->iColumn<0 ){
         1114  +        sqlite3_snprintf(nTemp, zTemp, "rowid");
         1115  +      }else{
         1116  +        sqlite3_snprintf(nTemp, zTemp, "c%d", (int)pExpr->iColumn);
         1117  +      }
  1114   1118         break;
  1115   1119       }
  1116   1120   
  1117   1121       case TK_LT:      zBinOp = "<";        break;
  1118   1122       case TK_LE:      zBinOp = "<=";       break;
  1119   1123       case TK_GT:      zBinOp = ">";        break;
  1120   1124       case TK_GE:      zBinOp = ">=";       break;

Changes to src/wherecode.c.

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