You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
jdbc-v2: ANTLR4 lexer does not nest /* */ block comments #3021
ClickHouse nests /* */ block comments — an inner /* raises the nesting level and only the matching */ ends the comment. The jdbc-v2 JavaCC grammar nests (commentNestingDepth in ClickHouseSqlParser.jj) and ClickHouseUtils.skipMultiLineComment nests, but the ANTLR4 lexer rule does not:
MULTI_LINE_COMMENT : '/*' .*? '*/' -> skip;
The non-greedy .*? ends the comment at the FIRST */, so everything after it is lexed as SQL. With the ANTLR4 / ANTLR4_PARAMS_PARSER backends this makes statements that the server accepts look like syntax errors, and it skews ? placeholder detection for the ANTLR4_PARAMS_PARSER backend (a ? inside the nested part of the comment is counted as a bind parameter).
Activity
Fix jdbc-v2: nest /* */ block comments in the ANTLR4 lexer