-C New\stest\scases\srefute\scheck-in\s[3f45007d544e5f78].
-D 2022-06-08T13:13:12.952
+C Add\srestriction\s(29)\sto\sthe\squery\sflattener\s-\sdo\snot\sallow\sflattening\sthat\nwould\sleave\sboth\sEP_InnerON\sand\sEP_OuterON\sconstraints\son\sthe\ssame\sjoin\sterm.
+D 2022-06-08T15:30:39.323
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 a4eb3c617027fd049b07432f3b942ea7151fa793a332a11a7d0f58c9539e104f
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
-F src/select.c 37d984cb3e007349ee5da55b3f3c9196e032e08938c9a58fd272acf1df873e61
+F src/select.c 0271d9099df40f210c45881ae6ce92e37d6a0e5d505179c56591383ebfb27844
F src/shell.c.in 5d5f27f88c4661b2b6e6859890e9c7fe00eac9a628743a12c44632705fc38309
F src/sqlite.h.in 172528c287399a34f188154017b7268bf82c6d5b780902e361958d2318c4e37c
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h a988810c9b21c0dc36dc7a62735012339dc76fc7ab448fb0792721d30eacb69d
-F src/sqliteInt.h bc88540ae44fa1a88c41b94bea247ff16709e95f0a81a1382a629e71f6b28426
+F src/sqliteInt.h 8353e96646372efdb0795a13cd9949831b4992c928de8f5c43b2524e8a4c6e7b
F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657
F src/status.c 4a3da6d77eeb3531cb0dbdf7047772a2a1b99f98c69e90ce009c75fe6328b2c0
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
F src/tokenize.c a38f52058b517929e264094abd0b5fd1e8e145a1aa43bc6f6a72ae5218f96c98
-F src/treeview.c 73facf395c8841653b9a54e789d8c80e15bc3d0d1cb9d16104c2d889c15e33cd
+F src/treeview.c c48bbb4b04a951dcecf95b464d0fe94930339af56688a77f18ee50a526bc1706
F src/trigger.c 61bea163b1fa3039bc572ed8312461b978e5c527e5301f302b078f4c1ccdec6a
F src/update.c 2cfaded82ca80ff56afb8c3ae5e88284e0824bfd86119827cc22481959f96f92
F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 3f45007d544e5f787d5837b4d9f484ba473d69cdba83c229228e9c2f6b972b75
-R c96b16d4cbc04e083033588816910e05
-T *branch * right-join-query-flattener
-T *sym-right-join-query-flattener *
-T -sym-trunk *
+P 12d3c96c39d12f6b01b77456eb874fff445ebfc60f50aada51b06ed37af364ea
+R 62242d663897e7023595ea200b941250
U drh
-Z 2df224370f3f0ffaebb8686aa2afb5ed
+Z bf1ecb15b60313b8c1381dc63e03a589
# Remove this line to create a well-formed Fossil manifest.
sqlite3SetJoinExpr(pRight->u3.pOn, pRight->iCursor, joinType);
p->pWhere = sqlite3ExprAnd(pParse, p->pWhere, pRight->u3.pOn);
pRight->u3.pOn = 0;
+ pRight->fg.isOn = 1;
}
}
return 0;
**
** (28) The subquery is not a MATERIALIZED CTE.
**
+** (29) Either the subquery is not the right-hand operand of a join with an
+** ON or USING clause nor the right-hand operand of a NATURAL JOIN, or
+** the right-most table within the FROM clause of the subquery
+** is not part of an outer join.
+**
**
** 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
return 0; /* (28) */
}
+ if( pSubSrc->nSrc>=2
+ && (pSubSrc->a[pSubSrc->nSrc-1].fg.jointype & JT_OUTER)!=0
+ ){
+ /* Reach here if the right-most term in the FROM clause of the subquery
+ ** is an outer join - the second half of (29) */
+ if( pSubitem->fg.jointype & JT_NATURAL
+ || pSubitem->fg.isUsing
+ || pSubitem->u3.pOn!=0
+ || pSubitem->fg.isOn
+ ){
+ return 0;
+ }
+ }
+
/* 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