/ Check-in [f56d305a]
Login

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

Overview
Comment:Improved VDBE branch coverage in the run-time frame-spec error detection logic of window functions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f56d305a7bad6608d51d8c8cef417ddb66cff50f0a75d28554ea669e47f3d90d
User & Date: drh 2019-04-01 14:30:30
Context
2019-04-01
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
14:01
Improved comments on the VDBE branch coverage testing logic. Fix the VDBE branch coverage measurement on the OP_MustBeInt opcode. check-in: 8681750e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/window.c.

  1305   1305     int regZero = sqlite3GetTempReg(pParse);
  1306   1306     assert( eCond>=0 && eCond<ArraySize(azErr) );
  1307   1307     sqlite3VdbeAddOp2(v, OP_Integer, 0, regZero);
  1308   1308     if( eCond>=WINDOW_STARTING_NUM ){
  1309   1309       int regString = sqlite3GetTempReg(pParse);
  1310   1310       sqlite3VdbeAddOp4(v, OP_String8, 0, regString, 0, "", P4_STATIC);
  1311   1311       sqlite3VdbeAddOp3(v, OP_Ge, regString, sqlite3VdbeCurrentAddr(v)+2, reg);
  1312         -    sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC);
         1312  +    sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC|SQLITE_JUMPIFNULL);
  1313   1313       VdbeCoverage(v);
  1314   1314       assert( eCond==3 || eCond==4 );
  1315   1315       VdbeCoverageIf(v, eCond==3);
  1316   1316       VdbeCoverageIf(v, eCond==4);
  1317   1317     }else{
  1318   1318       sqlite3VdbeAddOp2(v, OP_MustBeInt, reg, sqlite3VdbeCurrentAddr(v)+2);
  1319   1319       VdbeCoverage(v);
  1320   1320       assert( eCond==0 || eCond==1 || eCond==2 );
  1321   1321       VdbeCoverageIf(v, eCond==0);
  1322   1322       VdbeCoverageIf(v, eCond==1);
  1323   1323       VdbeCoverageIf(v, eCond==2);
  1324   1324     }
  1325   1325     sqlite3VdbeAddOp3(v, aOp[eCond], regZero, sqlite3VdbeCurrentAddr(v)+2, reg);
  1326         -  VdbeCoverageIf(v, eCond==0);
  1327         -  VdbeCoverageIf(v, eCond==1);
  1328         -  VdbeCoverageIf(v, eCond==2);
  1329         -  VdbeCoverageIf(v, eCond==3);
  1330         -  VdbeCoverageIf(v, eCond==4);
         1326  +  VdbeCoverageNeverNullIf(v, eCond==0); /* NULL case captured by */
         1327  +  VdbeCoverageNeverNullIf(v, eCond==1); /*   the OP_MustBeInt */
         1328  +  VdbeCoverageNeverNullIf(v, eCond==2);
         1329  +  VdbeCoverageNeverNullIf(v, eCond==3); /* NULL case caught by */
         1330  +  VdbeCoverageNeverNullIf(v, eCond==4); /*   the OP_Ge */
  1331   1331     sqlite3MayAbort(pParse);
  1332   1332     sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_ERROR, OE_Abort);
  1333   1333     sqlite3VdbeAppendP4(v, (void*)azErr[eCond], P4_STATIC);
  1334   1334     sqlite3ReleaseTempReg(pParse, regZero);
  1335   1335   }
  1336   1336   
  1337   1337   /*