aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/select.c b/src/select.c
index 6d185a168..d65719e0a 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4122,6 +4122,9 @@ static void renumberCursors(
** (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
@@ -4241,6 +4244,11 @@ static int flattenSubquery(
}
#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