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
Switching a ClickHouse connection to another schema corrupts bracketed IPv6 JDBC URLs. ClickHouseDBManager splits the URL using the bare host and port as a regular expression, which cannot match the bracketed IPv6 authority and does not safely preserve URL query or fragment suffixes.
Steps to Reproduce
Configure a ClickHouse connection with URL jdbc:clickhouse://[2001:db8::1]:8123/default?ssl=true.
Store the connection host as 2001:db8::1 and port as 8123.
Switch the connection schema to analytics.
Expected Behavior
The URL becomes jdbc:clickhouse://[2001:db8::1]:8123/analytics?ssl=true and remains stable on reconnect. Query parameters and ClickHouse fragment tags are preserved.
Actual Behavior
The host and port split does not match the bracketed authority. The implementation appends the bare address and schema to the existing URL, producing a malformed value such as jdbc:clickhouse://[2001:db8::1]:8123/default?ssl=true2001:db8::1:8123/analytics. The bad URL is then written back to ConnectInfo.
Logs
The ClickHouse driver rejects the malformed JDBC URL or connects with the wrong database.
Screenshots or Additional Context
ClickHouse supports schema switching and fragment tags. URL rewriting should replace only the database path while preserving the authority, query, and fragment boundaries.
Impact
IPv6 ClickHouse connections cannot reliably switch databases and reconnect attempts can reuse the corrupted URL.
Workaround
Manually restore the JDBC URL and avoid switching schemas from Chat2DB.
Submission Checklist
Reproduced on the selected Chat2DB edition.
Searched existing issues and pull requests for duplicates.
Thanks for the detailed reproduction. I understand that switching a ClickHouse schema rewrites a bracketed IPv6 JDBC URL incorrectly, appending the bare host and new schema while failing to preserve the URL boundaries.
The required Operating System Version field is missing. Please provide the exact OS and version for at least one environment where this was reproduced (and indicate whether it was the Web or Desktop deployment); that is the smallest remaining detail needed for a maintainer to proceed.
Activity
github-actions commentedon Aug 11, 2026
Thanks for the detailed reproduction. I understand that switching a ClickHouse schema rewrites a bracketed IPv6 JDBC URL incorrectly, appending the bare host and new schema while failing to preserve the URL boundaries.
The required Operating System Version field is missing. Please provide the exact OS and version for at least one environment where this was reproduced (and indicate whether it was the Web or Desktop deployment); that is the smallest remaining detail needed for a maintainer to proceed.