@@ -47,6 +47,10 @@ public final class StatementDetector implements TokenVisitor {
4747 // NOTE: This is a shortcut, if WITH is ever allowed as the first token of another statement type,
4848 // this must be changed to detect the first keyword after the entire WITH clause
4949 nextAfterStart .put ("WITH" , selectState );
50+ // Firebird 5.0+ parenthesized query expression
51+ // NOTE: This is a shortcut, if parenthesis at the top-level are ever allowed for anything other than SELECT (or
52+ // SELECT-like statements), this needs to be reworked
53+ nextAfterStart .put ("(" , selectState );
5054 nextAfterStart .put ("EXECUTE" , new StateAfterStart (ParserState .EXECUTE , LocalStatementType .OTHER ));
5155 nextAfterStart .put ("UPDATE" , new StateAfterStart (ParserState .UPDATE , LocalStatementType .UPDATE ));
5256 nextAfterStart .put ("DELETE" , new StateAfterStart (ParserState .DELETE , LocalStatementType .DELETE ));
@@ -56,10 +60,6 @@ public final class StatementDetector implements TokenVisitor {
5660 nextAfterStart .put ("ROLLBACK" ,
5761 new StateAfterStart (ParserState .COMMIT_ROLLBACK , LocalStatementType .HARD_ROLLBACK ));
5862 nextAfterStart .put ("SET" , new StateAfterStart (ParserState .SET , LocalStatementType .OTHER ));
59- // Firebird 5.0+ parenthesized query expression
60- // NOTE: This is a shortcut, if parenthesis at the top-level are ever allowed for anything other than SELECT (or
61- // SELECT-like statements), this needs to be reworked
62- nextAfterStart .put ("(" , new StateAfterStart (ParserState .SELECT , LocalStatementType .SELECT ));
6363 // Firebird 6.0+ USING ... DO; need to find end of the USING clause to detect actual statement type
6464 nextAfterStart .put ("USING" , new StateAfterStart (ParserState .FIND_USING_END , LocalStatementType .OTHER ));
6565 // Firebird 6.0+ CALL
0 commit comments