-C New\stest\scases,\sincluding\sone\sthat\sgets\sa\sdifferent\sresult\sthan\sPostgres.
-D 2022-04-18T22:51:24.965
+C Fix\sthe\squery\sflattener\sso\sthat\sit\sdoes\snot\sflatten\sa\sRIGHT\sor\sFULL\sJOIN\sinto\nany\sposition\sof\sthe\souter\squery\sother\sthan\sthe\sfirst.
+D 2022-04-18T23:20:02.870
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c
F src/resolve.c ce4cb0889f1bf5990b698740b88026385cf6f30222fde1f02a3168bb780eb579
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
-F src/select.c 6544e02167adbb89a7152acf6ff2f0218a6de94146377b83e79bc8b09bf6f16e
+F src/select.c 459cea7ae6e6ff517b04ad3ec7ed6479b666096a85fcec5b4edec2d5cacca2d8
F src/shell.c.in ecff6f4ab0e8e25acd578b3eb27ac0bad4d48643c160259a277151d6e9d412e1
F src/sqlite.h.in 2a35f62185eb5e7ecc64a2f68442b538ce9be74f80f28a00abc24837edcf1c17
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F test/join6.test f809c025fa253f9e150c0e9afd4cef8813257bceeb6f46e04041228c9403cc2c
F test/join7.test 8e72de4b45e5e930d18c305c7efe86015fb2552731e4e03ea226353036b0dab0
F test/join8.test 6ed7eed8993e060e5e9d07f6bcadf1bb634742a03b9824afbcfa193adf7f9965
-F test/join9.test a651f427b9906fda7c3548a0a9dbec725b9e80e92a65787f9d2a845d49af649d
+F test/join9.test 9056ddd3b0c0f4f9d658f4521038d9a37dc23ead8ca9a505d0b0db2b6a471e05
F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497
F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4
F test/journal3.test 7c3cf23ffc77db06601c1fcfc9743de8441cb77db9d1aa931863d94f5ffa140e
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 5bcf4aa3bf6b1b9f47142bc37683bb3bf0adeffd052d07449af7c9b415add052
-R 81d9c0efaaa8f2b2681b74a83997038e
+P 49ea11a4a5fd630db44f458304d4f45fa103529ed6b36d538c78074965e8d799
+R f732ede2542062631f39bbd96137d61f
U drh
-Z 354a9aaf45b00cc0c5b254cdf7868063
+Z dd5cee205fd9f7e997652ba77ec73d51
# Remove this line to create a well-formed Fossil manifest.
** (26) The subquery may not be the right operand of a RIGHT JOIN.
** See also (3) for restrictions on LEFT JOIN.
**
+** (27) The subquery may not contain a FULL or RIGHT JOIN unless it
+** is the first element of the parent query.
+**
**
** In this routine, the "p" parameter is a pointer to the outer query.
** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
}
#endif
+ assert( pSubSrc->nSrc>0 ); /* True by restriction (7) */
+ if( iFrom>0 && (pSubSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
+ return 0; /* Restriction (27) */
+ }
+
/* Restriction (17): If the sub-query is a compound SELECT, then it must
** use only the UNION ALL operator. And none of the simple select queries
** that make up the compound SELECT are allowed to be aggregate or distinct
- - 8 dave - -
}
+ # Restriction (27) in the query flattener
# Verified by PG-14
do_execsql_test join9-$id.1000 {
WITH t56(id,y,z) AS (SELECT * FROM t5 FULL JOIN t6 USING(id) LIMIT 50)
4 bob green 444
}
+ # Verified by PG-14
+ do_execsql_test join9-$id.1020 {
+ SELECT id,x,y,z
+ FROM t4 FULL JOIN t5 USING(id) INNER JOIN t6 USING(id)
+ ORDER BY 1;
+ } {
+ 3 - yellow 333
+ 4 bob green 444
+ 5 - blue 555
+ }
+
+ # Verified by PG-14
+ do_execsql_test join9-$id.1030 {
+ WITH t45(id,x,y) AS (SELECT * FROM t4 FULL JOIN t5 USING(id) LIMIT 50)
+ SELECT id,x,y,z FROM t45 JOIN t6 USING(id)
+ ORDER BY 1;
+ } {
+ 3 - yellow 333
+ 4 bob green 444
+ 5 - blue 555
+ }
+
}
finish_test