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
jdbc-v2 tests: getTables without a schema scans every database on the server #3510
ciCI and release setup, or an issue that a CI job foundjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)jdbc-metadataDetail: JDBC metadata (DatabaseMetaData, ResultSetMetaData, type mapping)testsArea: test code, test helpers, test harness, test coverage
Two jdbc-v2 integration tests call DatabaseMetaData#getTables with a null schema pattern. With jdbc_metadata_use_show_statements (the default), that sends one SHOW FULL TABLES per database, so the tests' time grows with the number of databases on the server. On the shared Cloud service (run 47116712695) they take about 8 of jdbc-v2's 15 minutes:
Both tests check a table in one known database (system, and the connection's own), so they should pass it as the schema pattern. This also stops testGetTables's exactly-one-numbers assertion from depending on what the other databases contain.
Recommendation: Keep open — fix needed
Merge PR #3511: it moves both calls to one schema, and no other jdbc-v2 test calls getTables or getColumns with no schema. With its scope, the run sends 1 SHOW FULL TABLES query in place of 1 per database. It is approved, and its checks pass.
Status on main: Reproduced on main — the call of testGetTables sends one SHOW FULL TABLES per database (25 of 25), and returns 2 rows when another database has a numbers table.
Breaking change: No — the change is in test code only.
Analysis: The root cause in the issue is correct: getTables ignores the catalog (DatabaseMetaDataImpl.java:1001-1008), and the SHOW path runs one SHOW FULL TABLES FROM <db> for each database that matches the schema pattern (ShowStatementsMetaData.java:195-197). The exactly-one assertion is DatabaseMetaDataTest.java:528: it fails when another database has a table named numbers.
Output on main (ea662722e), ClickHouse 26.11.7.10:
databases on the server: 25
getTables("system", null, "numbers", null): rows=2, SHOW FULL TABLES queries=25
getTables(null, "system", "numbers", null): rows=1, SHOW FULL TABLES queries=1
Automated triage by Polyglot AI. A maintainer makes the final decision.
ciCI and release setup, or an issue that a CI job foundjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)jdbc-metadataDetail: JDBC metadata (DatabaseMetaData, ResultSetMetaData, type mapping)testsArea: test code, test helpers, test harness, test coverage
Activity
polyglotAI-bot commentedon Dec 3, 2026
Recommendation: Keep open — fix needed
Merge PR #3511: it moves both calls to one schema, and no other jdbc-v2 test calls
getTablesorgetColumnswith no schema. With its scope, the run sends 1SHOW FULL TABLESquery in place of 1 per database. It is approved, and its checks pass.main: Reproduced on main — the call oftestGetTablessends oneSHOW FULL TABLESper database (25 of 25), and returns 2 rows when another database has anumberstable.Analysis: The root cause in the issue is correct:
getTablesignores the catalog (DatabaseMetaDataImpl.java:1001-1008), and the SHOW path runs oneSHOW FULL TABLES FROM <db>for each database that matches the schema pattern (ShowStatementsMetaData.java:195-197). The exactly-one assertion isDatabaseMetaDataTest.java:528: it fails when another database has a table namednumbers.Reproduction: complete program and output
Output on
main(ea662722e), ClickHouse 26.11.7.10:Automated triage by Polyglot AI. A maintainer makes the final decision.