/ Check-in [a69bb4f2]
Login

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

Overview
Comment:Mark rowid-comparison opcodes as never-null for VDBE coverage tracking purposes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a69bb4f257500e40ef4056d5628ef25266def5bcef07eebdb471a79fffe80237
User & Date: drh 2019-04-01 15:55:38
Context
2019-04-01
16:23
Frame range comparisons can never be NULL because the values will have been checked for NULL prior to the test. check-in: fa37cf9a user: drh tags: trunk
15:55
Mark rowid-comparison opcodes as never-null for VDBE coverage tracking purposes. check-in: a69bb4f2 user: drh tags: trunk
14:30
Improved VDBE branch coverage in the run-time frame-spec error detection logic of window functions. check-in: f56d305a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/window.c.

  1573   1573     addrNext = sqlite3VdbeCurrentAddr(v);
  1574   1574     sqlite3VdbeAddOp2(v, OP_Rowid, csr, regRowid);
  1575   1575     sqlite3VdbeAddOp3(v, OP_Gt, pMWin->regEndRowid, lblBrk, regRowid);
  1576   1576     VdbeCoverageNeverNull(v);
  1577   1577   
  1578   1578     if( pMWin->eExclude==TK_CURRENT ){
  1579   1579       sqlite3VdbeAddOp3(v, OP_Eq, regCRowid, lblNext, regRowid);
  1580         -    VdbeCoverage(v);
         1580  +    VdbeCoverageNeverNull(v);
  1581   1581     }else if( pMWin->eExclude!=TK_NO ){
  1582   1582       int addr;
  1583   1583       int addrEq = 0;
  1584   1584       KeyInfo *pKeyInfo = 0;
  1585   1585   
  1586   1586       if( pMWin->pOrderBy ){
  1587   1587         pKeyInfo = sqlite3KeyInfoFromExprList(pParse, pMWin->pOrderBy, 0, 0);
  1588   1588       }
  1589   1589       if( pMWin->eExclude==TK_TIES ){
  1590   1590         addrEq = sqlite3VdbeAddOp3(v, OP_Eq, regCRowid, 0, regRowid);
  1591         -      VdbeCoverage(v);
         1591  +      VdbeCoverageNeverNull(v);
  1592   1592       }
  1593   1593       if( pKeyInfo ){
  1594   1594         windowReadPeerValues(p, csr, regPeer);
  1595   1595         sqlite3VdbeAddOp3(v, OP_Compare, regPeer, regCPeer, nPeer);
  1596   1596         sqlite3VdbeAppendP4(v, (void*)pKeyInfo, P4_KEYINFO);
  1597   1597         addr = sqlite3VdbeCurrentAddr(v)+1;
  1598   1598         sqlite3VdbeAddOp3(v, OP_Jump, addr, lblNext, addr);
................................................................................
  2522   2522       sqlite3VdbeAddOp3(v, OP_Copy, regNewPart, pMWin->regPart, nPart-1);
  2523   2523     }
  2524   2524   
  2525   2525     /* Insert the new row into the ephemeral table */
  2526   2526     sqlite3VdbeAddOp2(v, OP_NewRowid, csrWrite, regRowid);
  2527   2527     sqlite3VdbeAddOp3(v, OP_Insert, csrWrite, regRecord, regRowid);
  2528   2528     addrNe = sqlite3VdbeAddOp3(v, OP_Ne, pMWin->regOne, 0, regRowid);
  2529         -  VdbeCoverage(v);
         2529  +  VdbeCoverageNeverNull(v);
  2530   2530   
  2531   2531     /* This block is run for the first row of each partition */
  2532   2532     s.regArg = windowInitAccum(pParse, pMWin);
  2533   2533   
  2534   2534     if( regStart ){
  2535   2535       sqlite3ExprCode(pParse, pMWin->pStart, regStart);
  2536   2536       windowCheckValue(pParse, regStart, 0 + (pMWin->eFrmType==TK_RANGE ? 3 : 0));