aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-03-02 01:16:33 +0000
committerdrh <drh@noemail.net>2020-03-02 01:16:33 +0000
commit7f05d52c4cb84b06c90c325e34d9d1a334357554 (patch)
tree3e897f871d48eea617990eac3d5ee60bb31a51c8 /src/wherecode.c
parent0a21ea997dfcf520be78957dedd1e905b55446b2 (diff)
downloadsqlite-7f05d52c4cb84b06c90c325e34d9d1a334357554.tar.gz
sqlite-7f05d52c4cb84b06c90c325e34d9d1a334357554.zip
Ensure that the NULL-scan pass counter is initialized when a ORDER BY NULLS LAST
is used on the right table of a LEFT JOIN. Ticket [e12a0ae526bb51c7]. FossilOrigin-Name: 704bb9a39acbee420c1d6ac9eb1466a02dd77d3334b938bfddf235973129b5fe
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index e2e10f761..4e8b21170 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -1711,6 +1711,9 @@ Bitmask sqlite3WhereCodeOneLoopStart(
nExtraReg = 1;
bSeekPastNull = 1;
pLevel->regBignull = regBignull = ++pParse->nMem;
+ if( pLevel->iLeftJoin ){
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, regBignull);
+ }
pLevel->addrBignull = sqlite3VdbeMakeLabel(pParse);
}