SQLite

Check-in [2be661a480]
Login

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

Overview
Comment:This change generates incorrect code when there are two or more IN operators in the WHERE clause that are both used by the same index. Was: Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | mistake
Files: files | file ages | folders
SHA1: 2be661a48023f41464ae020b90dd2542a733f968
User & Date: drh 2012-09-18 17:32:02.856
Original Comment: Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid.
References
2012-09-18
19:29
Enhance IN processing to allow efficient use of indices with numeric affinities. Add test cases for IN processing that would have spotted the error in the [2be661a48023f4] check-in. (check-in: 5ded9b6838 user: drh tags: trunk)
Context
2012-09-18
17:32
This change generates incorrect code when there are two or more IN operators in the WHERE clause that are both used by the same index. Was: Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid. (Closed-Leaf check-in: 2be661a480 user: drh tags: mistake)
17:08
Enhancements to the comments on sqlite3FindInIndex(). No code changes. (check-in: b1a4c39499 user: drh tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/where.c.
3528
3529
3530
3531
3532
3533
3534
3535
3536

3537
3538
3539
3540
3541
3542
3543
    if( pIn ){
      pIn += pLevel->u.in.nIn - 1;
      pIn->iCur = iTab;
      if( eType==IN_INDEX_ROWID ){
        pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg);
      }else{
        pIn->addrInTop = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg);
      }
      sqlite3VdbeAddOp1(v, OP_IsNull, iReg);

    }else{
      pLevel->u.in.nIn = 0;
    }
#endif
  }
  disableTerm(pLevel, pTerm);
  return iReg;







<

>







3528
3529
3530
3531
3532
3533
3534

3535
3536
3537
3538
3539
3540
3541
3542
3543
    if( pIn ){
      pIn += pLevel->u.in.nIn - 1;
      pIn->iCur = iTab;
      if( eType==IN_INDEX_ROWID ){
        pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg);
      }else{
        pIn->addrInTop = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg);

      sqlite3VdbeAddOp1(v, OP_IsNull, iReg);
      }
    }else{
      pLevel->u.in.nIn = 0;
    }
#endif
  }
  disableTerm(pLevel, pTerm);
  return iReg;