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
clickhouse-jdbc (v1): the JavaCC SQL parser has no heredoc token, so a ; inside $$...$$ truncates the statement #3039
The legacy clickhouse-jdbc (v1) JavaCC grammar
(clickhouse-jdbc/src/main/javacc/ClickHouseSqlParser.jj) has no heredoc token, so the body of a
ClickHouse heredoc literal ($$body$$ / $tag$body$tag$) is lexed as ordinary SQL. Consequences:
a ; inside a heredoc body ends the statement: select $$a;b$$ parses to a single statement whose
SQL is only select $$a, i.e. the rest of the query is silently dropped. Because ClickHouseConnectionImpl.prepareStatement builds the prepared query from parsedStmt.getSQL(),
the driver then sends the truncated SQL to the server;
a body character that is not a valid token in that position (?, an operator, ...) aborts the
parse, so the statement is classified as UNKNOWN with no table name — e.g. select $$a?b$$, 1 from tbl and insert into tbl values ($$a;b$$, 1).
This is the v1 counterpart of #3029 / #3031 (the jdbc-v2 JavaCC and ANTLR4 grammars) and is a
separate mechanism from #3035 (the v1 JdbcParameterizedQuery placeholder scan) — both layers have
to know about heredocs for the v1 driver to accept such a statement.
Activity
chernser commentedon Aug 18, 2026
wontfix in V1 - fix is risky and need more effort. will be reviewed in V2