/ Check-in [b287520c]
Login

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

Overview
Comment:Fix VDBE branch accounting on comparison operators.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b287520c9226f7a9fab98142f5c207bfe959cd7e
User & Date: drh 2014-02-18 11:31:59
Context
2014-02-19
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
03:07
Add VdbeCoverage() and VdbeCoverageIf() macros for improved VDBE coverage testing. check-in: b92d31a9 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  1905   1905         ** The jump is taken if the SQLITE_JUMPIFNULL bit is set.
  1906   1906         */
  1907   1907         if( pOp->p5 & SQLITE_STOREP2 ){
  1908   1908           pOut = &aMem[pOp->p2];
  1909   1909           MemSetTypeFlag(pOut, MEM_Null);
  1910   1910           REGISTER_TRACE(pOp->p2, pOut);
  1911   1911         }else{
  1912         -        VdbeBranchTaken((pOp->p5 & SQLITE_JUMPIFNULL)?2:3,4);
         1912  +        VdbeBranchTaken(2,3);
  1913   1913           if( pOp->p5 & SQLITE_JUMPIFNULL ){
  1914   1914             pc = pOp->p2-1;
  1915   1915           }
  1916   1916         }
  1917   1917         break;
  1918   1918       }
  1919   1919     }else{
................................................................................
  1942   1942     if( pOp->p5 & SQLITE_STOREP2 ){
  1943   1943       pOut = &aMem[pOp->p2];
  1944   1944       memAboutToChange(p, pOut);
  1945   1945       MemSetTypeFlag(pOut, MEM_Int);
  1946   1946       pOut->u.i = res;
  1947   1947       REGISTER_TRACE(pOp->p2, pOut);
  1948   1948     }else{
  1949         -    VdbeBranchTaken(res!=0, 4);
         1949  +    VdbeBranchTaken(res!=0, (pOp->p5 & SQLITE_NULLEQ)?2:3);
  1950   1950       if( res ){
  1951   1951         pc = pOp->p2-1;
  1952   1952       }
  1953   1953     }
  1954   1954     /* Undo any changes made by applyAffinity() to the input registers. */
  1955   1955     pIn1->flags = (pIn1->flags&~MEM_TypeMask) | (flags1&MEM_TypeMask);
  1956   1956     pIn3->flags = (pIn3->flags&~MEM_TypeMask) | (flags3&MEM_TypeMask);