Repository navigation
Description
Description
clickhouse.jdbc.v1 is listed in the Driver properties table of the JDBC docs
(docs/clickhouse-docs/jdbc.mdx:82, default false). When an application passes it as a connection
property or as a URL query parameter, jdbc-v2 does not create the connection: the key is not in
DriverProperties, so JdbcConfiguration.buildFinalProperties forwards it to client-v2, and
client-v2's strict validator rejects it.
java.sql.SQLException: Failed to create connection
Caused by: com.clickhouse.client.api.ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
This is the same class of problem as #3218 (disable_frameworks_detection, fixed by #3282) — a
property that the docs list as a driver property is forwarded into the unknown-key validator and
kills connection creation. disable_frameworks_detection now works; clickhouse.jdbc.v1 is the
remaining row of that table with no DriverProperties entry.
It is reachable through the combined driver too: com.clickhouse.jdbc.ClickHouseDriver.isV2(url)
(clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/ClickHouseDriver.java:61) only routes to V1 when
the URL contains clickhouse.jdbc.v1=true. A user who writes the documented clickhouse.jdbc.v1=false
explicitly (to opt into V2) is routed to V2 with the parameter still in the URL, and the connection fails.
Note the docs are inconsistent with themselves: jdbc.mdx:52 says clickhouse.jdbc.v1 is a system
property, while jdbc.mdx:82 lists it in the driver-properties table.
ClickHouse server version
26.11.2.4 (the failure happens during connect, before any server request).
Reproduction
TestNG test in jdbc-v2 (jdbc-v2/src/test/java/com/clickhouse/jdbc/...), run against a local server
on http://localhost:8123:
package com.clickhouse.jdbc;
import org.testng.annotations.Test;
import java.sql.Connection;
import java.util.Properties;
public class V1PropTest {
private static final String URL = "jdbc:clickhouse://localhost:8123/default";
@Test
public void documentedV1PropertyInUrl() throws Exception {
try (Connection c = new Driver().connect(URL + "?clickhouse.jdbc.v1=false", new Properties())) {
assert c != null;
}
}
@Test
public void documentedV1PropertyInProperties() throws Exception {
Properties props = new Properties();
props.setProperty("clickhouse.jdbc.v1", "false");
try (Connection c = new Driver().connect(URL, props)) {
assert c != null;
}
}
}Expected: both connections are created (the property is documented, and the V2 driver is already the
implementation being asked for).
Actual (main @ 67775d0d3, 0.12.0-rc1-SNAPSHOT):
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
java.sql.SQLException: Failed to create connection
Caused by: com.clickhouse.client.api.ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
java.sql.SQLException: Failed to create connection
Caused by: com.clickhouse.client.api.ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
A wider run of the same setup, for comparison (same build, printing the root cause instead of asserting):
| Case | Result |
|---|---|
| no properties | OK |
URL ?clickhouse.jdbc.v1=false |
ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1] |
URL ?clickhouse.jdbc.v1=true |
ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1] |
Properties clickhouse.jdbc.v1=false |
ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1] |
Properties disable_frameworks_detection=true |
OK (fixed by #3282) |
Root cause
jdbc-v2/src/main/java/com/clickhouse/jdbc/DriverProperties.java: no entry forclickhouse.jdbc.v1.jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/JdbcConfiguration.java:397-401: a key that is not
inDRIVER_PROP_KEYSgoes intoclientPropertiesand is sent toClient.Builder.client-v2/src/main/java/com/clickhouse/client/api/ClientConfigProperties.java:552-560
(parseConfigMap): an unknown key throwsClientMisconfigurationExceptionunless
ignore_unknown_config_key=true.
Suggested fix
Pick one spelling of the contract and make code and docs agree, as was done for
disable_frameworks_detection:
- Add a
DriverPropertiesentry forclickhouse.jdbc.v1(defaultfalse) sobuildFinalProperties
keeps it indriverPropertiesand does not forward it to the client; the V2 driver can then ignore
it (the V1/V2 choice is already made byClickHouseDriver.isV2), or - Remove the row from the driver-properties table in
docs/clickhouse-docs/jdbc.mdx:82and keep only
the system-property description atjdbc.mdx:52— but then a URL with the documented
clickhouse.jdbc.v1=falsestill fails, so option 1 is the safer one.
Behavior that must not change: other unknown keys must still throw ClientMisconfigurationException
(#2712).
Link
Found while checking whether ClickHouse/clickhouse-js#1215 (documented URL parameter application_id
rejected by the strict unknown-parameter validator) applies to this client. The JS issue itself does not
apply here (the Java client name property is client_name and it matches the docs), but the same bug
class does, with clickhouse.jdbc.v1.
Activity
polyglotAI-bot commentedon Nov 26, 2026
Recommendation: Keep open — maintainer decision
Decide whether
clickhouse.jdbc.v1is a connection property or only a system property (jdbc.mdxsays both), then make the code or the docs agree. No open PR.main: Reproduced on main — the issue's two cases fail as it shows; the key also fails throughDriverManager(ClickHouseDriver), andclickhouse.jdbc.v1=trueinPropertiesdoes not select v1.Analysis:
DriverPropertieshas no entry forclickhouse.jdbc.v1, soJdbcConfiguration.java:393-401passes it to client-v2, which rejects unknown keys (ClientConfigProperties.java:554-558).ClickHouseDriver.isV2(clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/ClickHouseDriver.java:50-74) reads the flag only from the system property and the URL text, so the key inPropertiesnever selects v1.docs/clickhouse-docs/jdbc.mdx:52calls it a system property; the driver-property table at:82lists it.Reproduction: complete program and output
Changed from the issue's steps: the two TestNG cases as a
main, with a password; added the key throughDriverManager,clickhouse.jdbc.v1=trueinProperties, and a contrast case.Output on
main(8480ca001), ClickHouse 26.11.2.4:Automated triage by Polyglot AI. A maintainer makes the final decision.