More test cases and bug fixes.

FossilOrigin-Name: 140e97fde94fdc3babdd456ce1b22900ead0e40e2afe63d89d21ccdbf141b607
This commit is contained in:
drh 2022-04-10 17:14:48 +00:00
parent a20c71e9e8
commit e21e36dd2c
4 changed files with 56 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C More\sRIGHT\sJOIN\stest\scases\sand\sa\sbug\sfix.
D 2022-04-10T16:13:37.815
C More\stest\scases\sand\sbug\sfixes.
D 2022-04-10T17:14:48.880
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -639,7 +639,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c b9df133a705093da8977da5eb202eaadb844839f1c7297c08d33471f5491843d
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b
F src/where.c ca328251a356781a30c31f924ac935e4e5c8796e2174f50f18fbe3748de27073
F src/where.c 4e72f26033d0977c4f5a21a06968d319b8c6eae8507f47a6245291cf570151a4
F src/whereInt.h ecf0d9fe3e35f2546e660c6389e56aedb6fd2434e31a0449b261ff55ebc6df2d
F src/wherecode.c 39532c183ea306ae44b5ab3119b244407b46970b088c59d5751c5724b4b6ec15
F src/whereexpr.c ac8985bbd983f34273b1e0d05cd738ff436331674c1b22f4caf6537e1eca4691
@ -1146,7 +1146,7 @@ F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
F test/join5.test 0d63c7e43b3160b9d4b93f196ef83b6efc7751b9edd0d18c53a46fbec7a49cfc
F test/join6.test f809c025fa253f9e150c0e9afd4cef8813257bceeb6f46e04041228c9403cc2c
F test/join7.test bdd814adf382f3202e8a1f0c0e03afc53d99cc389d80dfa2b25fc846635473f7
F test/join7.test efcf2ed9d568ab8d2f4145c25fd2a8ea5abc56290c3c5345f9af9aa7e08af693
F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497
F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4
F test/journal3.test 7c3cf23ffc77db06601c1fcfc9743de8441cb77db9d1aa931863d94f5ffa140e
@ -1946,8 +1946,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P f2201d5dcfc552bdddd0780b3f466bdaa886e557f147335c085395bfc001f6b0
R af557aa48dcfca848766b5b48b1cbd15
P 19e8ad690a140ca40838bf31a377c19010fcbbc2554a4f1746737543043e334b
R 9017b4087148be50d8587c5d8e48484b
U drh
Z 2e79fb43e827a0cdd68dfc64d0cf2a68
Z 12573aa0d9ba0f1640cbd083fd7493c6
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
19e8ad690a140ca40838bf31a377c19010fcbbc2554a4f1746737543043e334b
140e97fde94fdc3babdd456ce1b22900ead0e40e2afe63d89d21ccdbf141b607

View File

@ -5894,6 +5894,7 @@ WhereInfo *sqlite3WhereBegin(
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pRJ->iMatch, pPk->nKeyCol);
sqlite3VdbeSetP4KeyInfo(pParse, pPk);
}
pLoop->wsFlags &= ~WHERE_IDX_ONLY;
}
}
pWInfo->iTop = sqlite3VdbeCurrentAddr(v);
@ -6169,10 +6170,15 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
WhereClause *pWC = &pWInfo->sWC;
WhereInfo *pSubWInfo;
SrcList sFrom;
Bitmask mAll = 0;
for(k=0; k<=i; k++){
mAll |= pWInfo->a[k].pWLoop->maskSelf;
}
for(k=0; k<pWC->nTerm; k++){
WhereTerm *pTerm = &pWC->a[i];
WhereTerm *pTerm = &pWC->a[k];
if( pTerm->wtFlags & TERM_VIRTUAL ) break;
if( pTerm->prereqAll & ~pLoop->maskSelf ) continue;
if( pTerm->prereqAll & ~mAll ) continue;
if( ExprHasProperty(pTerm->pExpr, EP_FromJoin) ) continue;
pSubWhere = sqlite3ExprAnd(pParse, pSubWhere,
sqlite3ExprDup(db, pTerm->pExpr, 0));
}
@ -6208,6 +6214,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
sqlite3WhereEnd(pSubWInfo);
}
sqlite3ExprDelete(pParse->db, pSubWhere);
continue;
}
/* For a co-routine, change all OP_Column references to the table of

View File

@ -63,4 +63,43 @@ do_execsql_test join7-1.5 {
1 4 4 44
}
do_execsql_test join7-2.1 {
SELECT quote(a), quote(b), quote(c), quote(d)
FROM t1 FULL OUTER JOIN t2 ON b=c AND a=1 ORDER BY +b;
} {
NULL NULL 5 55
1 2 NULL NULL
1 3 3 33
1 4 4 44
}
do_execsql_test join7-2.2 {
SELECT quote(a), quote(b), quote(c), quote(d)
FROM t1 FULL OUTER JOIN t2 ON b=c WHERE a=1 ORDER BY +b;
} {
1 2 NULL NULL
1 3 3 33
1 4 4 44
}
do_execsql_test join7-2.3 {
SELECT quote(a), quote(b), quote(c), quote(d)
FROM t1 FULL OUTER JOIN t2 ON b=c WHERE a IS NULL ORDER BY +d;
} {
NULL NULL 3 33
NULL NULL 4 44
NULL NULL 5 55
}
do_execsql_test join7-2.4 {
SELECT quote(a), quote(b), quote(c), quote(d)
FROM t1 FULL OUTER JOIN t2 ON b=c AND d<=0 ORDER BY +b, +d;
} {
NULL NULL 3 33
NULL NULL 4 44
NULL NULL 5 55
1 2 NULL NULL
1 3 NULL NULL
1 4 NULL NULL
}
finish_test