Unexpected BadSqlGrammarException
Instead of TimeoutException
on Query Timeout
#1972
Labels
Milestone
BadSqlGrammarException
Instead of TimeoutException
on Query Timeout
#1972
Describe the bug
When using the ClickHouse JDBC driver with JdbcTemplate in a Spring application, a query timeout is set using JdbcTemplate.setQueryTimeout(10). However, when the query exceeds the configured timeout, a BadSqlGrammarException is thrown instead of the expected TimeoutException. This behavior is misleading as it suggests an issue with SQL syntax rather than a timeout.
Steps to reproduce
Expected behaviour
A TimeoutException or another appropriate exception should be thrown to clearly indicate that the query execution exceeded the configured timeout.
Code example
Error log
Configuration
Environment
ClickHouse server
CREATE TABLE
statements for tables involved:The text was updated successfully, but these errors were encountered: