SQLite

Check-in [787c76a8]
Login

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

Overview
Comment:When an index is used by all branches of the WHERE_MULTI_OR optimization and becomes a covering index, make sure the index has been created prior to NULLing it in the OP_NullRow opcode of a LEFT JOIN. See forum post 0575376e07. The covering-index for WHERE_MULTI_OR optimization was added by [62678be3df35cdcb]. Test cases are in the orindex01.test module of TH3.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 787c76a865dc51dbca4f30432d64783199c2efb1df4619e4bbaf32182977321e
User & Date: drh 2021-06-22 23:24:58
Context
2021-06-23
11:12
Fix a problem handling ORDER BY terms of the form "ORDER BY likely(<integer>)" within window frames. (check-in: 710f75b9 user: dan tags: trunk)
2021-06-22
23:24
When an index is used by all branches of the WHERE_MULTI_OR optimization and becomes a covering index, make sure the index has been created prior to NULLing it in the OP_NullRow opcode of a LEFT JOIN. See forum post 0575376e07. The covering-index for WHERE_MULTI_OR optimization was added by [62678be3df35cdcb]. Test cases are in the orindex01.test module of TH3. (check-in: 787c76a8 user: drh tags: trunk)
18:32
Add the sqlite3_changes64() and sqlite3_total_changes64() API functions. (check-in: 48fdec22 user: dan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/where.c.

5524
5525
5526
5527
5528
5529
5530






5531
5532
5533
5534
5535
5536
5537
      if( (ws & WHERE_IDX_ONLY)==0 ){
        assert( pLevel->iTabCur==pTabList->a[pLevel->iFrom].iCursor );
        sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iTabCur);
      }
      if( (ws & WHERE_INDEXED) 
       || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) 
      ){






        sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur);
      }
      if( pLevel->op==OP_Return ){
        sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst);
      }else{
        sqlite3VdbeGoto(v, pLevel->addrFirst);
      }







>
>
>
>
>
>







5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
      if( (ws & WHERE_IDX_ONLY)==0 ){
        assert( pLevel->iTabCur==pTabList->a[pLevel->iFrom].iCursor );
        sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iTabCur);
      }
      if( (ws & WHERE_INDEXED) 
       || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) 
      ){
        if( ws & WHERE_MULTI_OR ){
          Index *pIx = pLevel->u.pCovidx;
          int iDb = sqlite3SchemaToIndex(db, pIx->pSchema);
          sqlite3VdbeAddOp3(v, OP_ReopenIdx, pLevel->iIdxCur, pIx->tnum, iDb);
          sqlite3VdbeSetP4KeyInfo(pParse, pIx);
        }
        sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur);
      }
      if( pLevel->op==OP_Return ){
        sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst);
      }else{
        sqlite3VdbeGoto(v, pLevel->addrFirst);
      }