-
Couldn't load subscription status.
- Fork 613
Open
Labels
Milestone
Description
Description
When using spring's NamedParameterJdbcTemplate, a IN with a named value is converted to a IN with a list of parameters.
For example, SELECT myColumn FROM myTable WHERE myColumn in (:values) is converted to SELECT myColumn FROM myTable WHERE myColumn in (?, ?, ?).
It leads to a PreparedStatement with 0 as argCount.
Steps to reproduce
- Execute a query using NamedParameterJdbcTemplate with a list as a named parameter
Error Log or Exception StackTrace
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at com.clickhouse.jdbc.PreparedStatementImpl.setString(PreparedStatementImpl.java:210)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setString(HikariProxyPreparedStatement.java)
at org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:438)
at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:242)
at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:158)
at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.setValues(PreparedStatementCreatorFactory.java:282)
at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:245)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:656)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:723)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:748)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForRowSet(NamedParameterJdbcTemplate.java:324)
Expected Behaviour
We can set a list as parameter
Configuration
Environment
- Cloud
- Client version: 0.9.2
- Language version:
- OS:
ClickHouse Server
- ClickHouse Server version: 25.2.2