diff options
author | drh <> | 2024-04-22 00:42:47 +0000 |
---|---|---|
committer | drh <> | 2024-04-22 00:42:47 +0000 |
commit | 2c26adb87397842f90122a1029cb84d3f45a4090 (patch) | |
tree | 952033646bc0bbdd7c231e6a80c7fd75071a8a6f /src | |
parent | db2a33a3dd9ea37180f22dce60c2b6bbbfd781bf (diff) | |
download | sqlite-2c26adb87397842f90122a1029cb84d3f45a4090.tar.gz sqlite-2c26adb87397842f90122a1029cb84d3f45a4090.zip |
Continuation of the fix at [8c0f69e0e4ae0a44]: If a viaCoroutine FROM clause
term is participating in a RIGHT or FULL JOIN, we have to create an
always-NULL pseudo-cursor for that term when processing the RIGHT join.
dbsqlfuzz 6fd1ff3a64bef4a6c092e8d757548e95698b0df5.
FossilOrigin-Name: e1040e51ebd04f2a076f477b6f240f849afb10f543ebe518e09d6842cc3cb38e
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 3 | ||||
-rw-r--r-- | src/wherecode.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 143fd49c1..d8b471de2 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -4584,7 +4584,8 @@ case OP_SequenceTest: { ** is the only cursor opcode that works with a pseudo-table. ** ** P3 is the number of fields in the records that will be stored by -** the pseudo-table. +** the pseudo-table. If P2 is 0 or negative then the pseudo-cursor +** will return NULL for every column. */ case OP_OpenPseudo: { VdbeCursor *pCx; diff --git a/src/wherecode.c b/src/wherecode.c index e91bc283b..cad2293dd 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -2739,6 +2739,7 @@ SQLITE_NOINLINE void sqlite3WhereRightJoinLoop( v, OP_Null, 0, pRight->regResult, pRight->regResult + pRight->pSelect->pEList->nExpr-1 ); + sqlite3VdbeAddOp1(v, OP_OpenPseudo, pWInfo->a[k].iTabCur); }else{ sqlite3VdbeAddOp1(v, OP_NullRow, pWInfo->a[k].iTabCur); iIdxCur = pWInfo->a[k].iIdxCur; |