/ Check-in [2be661a4]
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 | SQL archive
Timelines: family | ancestors | mistake
Files: files | file ages | folders
SHA1: 2be661a48023f41464ae020b90dd2542a733f968
User & Date: drh 2012-09-18 17:32:02
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: 5ded9b68 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: 2be661a4 user: drh tags: mistake
17:08
Enhancements to the comments on sqlite3FindInIndex(). No code changes. check-in: b1a4c394 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  3528   3528       if( pIn ){
  3529   3529         pIn += pLevel->u.in.nIn - 1;
  3530   3530         pIn->iCur = iTab;
  3531   3531         if( eType==IN_INDEX_ROWID ){
  3532   3532           pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg);
  3533   3533         }else{
  3534   3534           pIn->addrInTop = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg);
         3535  +        sqlite3VdbeAddOp1(v, OP_IsNull, iReg);
  3535   3536         }
  3536         -      sqlite3VdbeAddOp1(v, OP_IsNull, iReg);
  3537   3537       }else{
  3538   3538         pLevel->u.in.nIn = 0;
  3539   3539       }
  3540   3540   #endif
  3541   3541     }
  3542   3542     disableTerm(pLevel, pTerm);
  3543   3543     return iReg;