[#7171] Support parsing VALUES wherever a query primary can be used
This commit is contained in:
parent
47e045d4c4
commit
9422fbc5a2
@ -192,7 +192,7 @@ revokeStatement = 'REVOKE'
|
||||
'FROM' ( userName | roleName | 'PUBLIC')
|
||||
;
|
||||
|
||||
selectStatement = select | values [ correlationName ]
|
||||
selectStatement = select
|
||||
;
|
||||
|
||||
insertStatement = [ with ] 'INSERT INTO' tableName
|
||||
@ -305,6 +305,7 @@ select =
|
||||
[ orderBy ]
|
||||
[ offsetFetch ]
|
||||
[ forUpdate ]
|
||||
| values
|
||||
;
|
||||
|
||||
queryExpressionBody =
|
||||
|
||||
@ -669,7 +669,7 @@ final class ParserImpl implements Parser {
|
||||
case 'v':
|
||||
case 'V':
|
||||
if (!parseSelect && peekKeyword(ctx, "VALUES"))
|
||||
return ctx.dsl.selectFrom(parseTableValueConstructor(ctx));
|
||||
return parseSelect(ctx);
|
||||
|
||||
case 'w':
|
||||
case 'W':
|
||||
@ -911,6 +911,9 @@ final class ParserImpl implements Parser {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (peekKeyword(ctx, "VALUES"))
|
||||
return (SelectQueryImpl<Record>) ctx.dsl.selectQuery(parseTableValueConstructor(ctx));
|
||||
|
||||
parseKeyword(ctx, "SELECT");
|
||||
String hints = parseHints(ctx);
|
||||
boolean distinct = parseKeywordIf(ctx, "DISTINCT") || parseKeywordIf(ctx, "UNIQUE");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user