[jOOQ/jOOQ#18543] Parser cannot handle left-associative parenthesised nested set operations in derived table
This commit is contained in:
parent
48f51faa93
commit
f47010666e
@ -1457,8 +1457,12 @@ final class DefaultParseContext extends AbstractParseContext implements ParseCon
|
||||
}
|
||||
|
||||
private final SelectQueryImpl<Record> parseSelect(Integer degree, WithImpl with) {
|
||||
return parseSelect(degree, with, null);
|
||||
}
|
||||
|
||||
private final SelectQueryImpl<Record> parseSelect(Integer degree, WithImpl with, SelectQueryImpl<Record> prefix) {
|
||||
scope.scopeStart();
|
||||
SelectQueryImpl<Record> result = parseQueryExpressionBody(degree, with, null);
|
||||
SelectQueryImpl<Record> result = parseQueryExpressionBody(degree, with, prefix);
|
||||
List<SortField<?>> orderBy = null;
|
||||
|
||||
for (Field<?> field : result.getSelect())
|
||||
@ -7651,6 +7655,18 @@ final class DefaultParseContext extends AbstractParseContext implements ParseCon
|
||||
}
|
||||
else {
|
||||
result = parseJoinedTable(forbiddenKeywords);
|
||||
|
||||
// [#18543] We don't really know what the parentheses mean at this point, so
|
||||
// after the fact, if we happen to have parsed what looks like a
|
||||
// "derived table, we could still encounter more set operations or
|
||||
// ORDER BY .. LIMIT clauses
|
||||
if (result instanceof Table<?> t) {
|
||||
Select<?> s = Tools.extractSelectFromDerivedTable(t);
|
||||
|
||||
if (s != null)
|
||||
result = parseSelect(null, null, selectQueryImpl(s));
|
||||
}
|
||||
|
||||
parse(')');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user