Skip to content

fix(clickhouse): encode schema names in JDBC URLs - #2692

Open
HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/clickhouse-schema-url-encoding
Open

fix(clickhouse): encode schema names in JDBC URLs#2692
HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/clickhouse-schema-url-encoding

Conversation

@HandSonic

Copy link
Copy Markdown
Contributor

Summary

  • Encode the selected ClickHouse schema as one UTF-8 JDBC URL path segment before reconnecting.
  • Prevent /, ?, #, spaces, Unicode, plus signs, and literal percent text from changing URL structure or the selected schema.
  • Preserve the existing JDBC query suffix and add focused regression coverage.

Validation

  • Focused regression tests: 3 passed.
  • Full ClickHouse module tests: 46 passed, 0 failed.
  • ClickHouse reactor package: passed.
  • Fork code CI: frontend, backend, repository checks, Java/JavaScript CodeQL, SBOM, and license checks passed.
  • Independent adversarial review: no findings.

Follow-up regression fix related to #2685 for schema names containing reserved URL characters. This intentionally does not close that issue; the separate IPv6 URL fix is in #2690.

@HandSonic
HandSonic requested a review from openai0229 as a code owner August 12, 2026 02:26
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 12, 2026
@HandSonic
HandSonic force-pushed the fix/clickhouse-schema-url-encoding branch from 05a46c2 to d4e8177 Compare August 12, 2026 16:45
@HandSonic
HandSonic force-pushed the fix/clickhouse-schema-url-encoding branch from d4e8177 to 7da9798 Compare August 19, 2026 20:05

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking integration issue: this branch still applies encoding on top of the old implementation. That implementation is exactly what #2690 replaces because it cannot reliably preserve IPv6 authorities, no-path URLs, fragments, and other URL shapes. Merging the two fixes independently leaves overlapping implementations and an avoidable conflict.\n\nPlease base this change on #2690's helper and encode the schema as one UTF-8 path segment inside that helper. Keep the reserved-character tests from this PR and the IPv6/query/fragment tests from #2690 so there is one URL-rewrite implementation.

@openai0229
openai0229 dismissed their stale review August 20, 2026 03:45

Superseded by a corrected review because shell quoting corrupted the submitted text.

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking integration issue: this branch still applies encoding on top of the old url.split(connectAddress) implementation. That implementation is exactly what #2690 replaces because it cannot reliably preserve IPv6 authorities, no-path URLs, fragments, and other URL shapes. Merging the two fixes independently leaves overlapping implementations and an avoidable conflict.

Please base this change on #2690's replaceDatabaseInJdbcUrl helper and encode the schema as one UTF-8 path segment inside that helper. Keep the reserved-character tests from this PR and the IPv6/query/fragment tests from #2690 so there is one URL-rewrite implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants