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
bugjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)queriesArea: how the client builds and runs statements (parameters, quoting, batches)
DB::Exception: Syntax error: failed at position 1 (inser): inser t into apollo.tmp_jdbc_test (name, age) values ('insertMany1', 333),t into apollo.tmp_jdbc_test (name, age) values ('insertMany2', NULL);.
After some digging I found that the failure occurs because com.clickhouse.jdbc.PreparedStatementImpl#PreparedStatementImpl parses the input SQL into segments incorrectly. It assumes the input String sql is entirely upper-case, which produces an invalid result. Specifically, this line
looks for "VALUES" in the input string. When the keyword is lowercase, indexOf("VALUES") returns -1; adding 6 yields 5, so this.insertIntoSQL becomes "inser".
I can open a PR to fix this particular case by upper-casing originalSql before calling indexOf, but there might be other similar errors in the repository that are also worth checking.
bugjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)queriesArea: how the client builds and runs statements (parameters, quoting, batches)
Activity
chernser commentedon May 9, 2025
Good day, @aira-xite !
Thank you for reporting!