1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Invert the meaning of the regBignull flag so that it is 1 when doing the

normal scan and 1 when scanning nulls.  This enables the re-do jump at the
bottom of the loop to be coded with a single OP_IfNotZero opcode, rather
than a sequence of OP_If, OP_Integer, OP_Goto.

FossilOrigin-Name: bf875e1a259a4167694e06349458452dc36c1d38aa6843518d9ae46ce74e5559
This commit is contained in:
drh
2019-08-23 13:32:03 +00:00
parent 74e1b861ad
commit ec3dda5b11
5 changed files with 17 additions and 23 deletions

View File

@@ -5218,13 +5218,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
VdbeCoverageIf(v, pLevel->op==OP_VNext);
if( pLevel->regBignull ){
sqlite3VdbeResolveLabel(v, pLevel->addrBignull);
addr = sqlite3VdbeAddOp1(v, OP_If, pLevel->regBignull);
VdbeComment((v, "If NULL-scan done"));
VdbeCoverage(v);
sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->regBignull);
sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->p2-1);
VdbeComment((v, "Do the NULL-scan"));
sqlite3VdbeJumpHere(v, addr);
sqlite3VdbeAddOp2(v, OP_IfNotZero, pLevel->regBignull, pLevel->p2-1);
}
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);