/ Check-in [b9782564]
Login

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

Overview
Comment:Tweaks in support of VDBE branch test coverage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b97825646996792d0a67b83f135658027c8569ca
User & Date: drh 2014-02-19 00:53:46
Context
2014-02-19
01:31
Make sure a multi-row VALUES clause works correctly in a compound SELECT. check-in: 85b355cf user: drh tags: trunk
00:53
Tweaks in support of VDBE branch test coverage. check-in: b9782564 user: drh tags: trunk
2014-02-18
11:31
Fix VDBE branch accounting on comparison operators. check-in: b287520c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

   600    600     if( ALWAYS(v) ){
   601    601       int r1 = sqlite3GetTempReg(pParse);
   602    602       int r2 = sqlite3GetTempReg(pParse);
   603    603       int j1;
   604    604       sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT);
   605    605       sqlite3VdbeUsesBtree(v, iDb);
   606    606       sqlite3VdbeAddOp2(v, OP_Integer, minFormat, r2);
   607         -    j1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1); VdbeCoverage(v);
          607  +    j1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1);
          608  +    sqlite3VdbeChangeP5(v, SQLITE_NULLEQ); VdbeCoverage(v);
   608    609       sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, r2);
   609    610       sqlite3VdbeJumpHere(v, j1);
   610    611       sqlite3ReleaseTempReg(pParse, r1);
   611    612       sqlite3ReleaseTempReg(pParse, r2);
   612    613     }
   613    614   }
   614    615   

Changes to src/delete.c.

   609    609     /* Seek cursor iCur to the row to delete. If this row no longer exists 
   610    610     ** (this can happen if a trigger program has already deleted it), do
   611    611     ** not attempt to delete it or fire any DELETE triggers.  */
   612    612     iLabel = sqlite3VdbeMakeLabel(v);
   613    613     opSeek = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
   614    614     if( !bNoSeek ){
   615    615       sqlite3VdbeAddOp4Int(v, opSeek, iDataCur, iLabel, iPk, nPk);
   616         -    VdbeCoverage(v);
          616  +    VdbeCoverageIf(v, opSeek==OP_NotExists);
          617  +    VdbeCoverageIf(v, opSeek==OP_NotFound);
   617    618     }
   618    619    
   619    620     /* If there are any triggers to fire, allocate a range of registers to
   620    621     ** use for the old.* references in the triggers.  */
   621    622     if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
   622    623       u32 mask;                     /* Mask of OLD.* columns in use */
   623    624       int iCol;                     /* Iterator used while populating OLD.* */
................................................................................
   652    653       /* If any BEFORE triggers were coded, then seek the cursor to the 
   653    654       ** row to be deleted again. It may be that the BEFORE triggers moved
   654    655       ** the cursor or of already deleted the row that the cursor was
   655    656       ** pointing to.
   656    657       */
   657    658       if( addrStart<sqlite3VdbeCurrentAddr(v) ){
   658    659         sqlite3VdbeAddOp4Int(v, opSeek, iDataCur, iLabel, iPk, nPk);
   659         -      VdbeCoverage(v);
          660  +      VdbeCoverageIf(v, opSeek==OP_NotExists);
          661  +      VdbeCoverageIf(v, opSeek==OP_NotFound);
   660    662       }
   661    663   
   662    664       /* Do FK processing. This call checks that any FK constraints that
   663    665       ** refer to this table (i.e. constraints attached to other tables) 
   664    666       ** are not violated by deleting this row.  */
   665    667       sqlite3FkCheck(pParse, pTab, iOld, 0, 0, 0);
   666    668     }