fix(clickhouse): preserve Decimal precision when scale is null#2193
fix(clickhouse): preserve Decimal precision when scale is null#2193Aias00 wants to merge 2 commits into
Conversation
buildDataType guarded with columnSize == null || decimalDigits == null, returning bare Decimal for Decimal(10) (precision set, scale null). ClickHouse Decimal requires both P and S, so the size-only branch returns Decimal(P,0) instead of the invalid Decimal(P). Guard on columnSize only, making the branch reachable. Same dead-branch class as Sqlite OtterMind#2167 / MySQL OtterMind#2180 / Snowflake OtterMind#2188 / Hive OtterMind#2189. Fixes OtterMind#2192 Co-Authored-By: Claude <noreply@anthropic.com>
Live-database verification (same bug class)Verified the same |
|
Thanks for the follow-up. I do not think this is ready to merge yet. The premise in the verification is inaccurate: ClickHouse supports both Please verify the actual reachable path, rebase onto the latest |
Related issue
Closes #2192
Summary
Same dead-branch bug as Sqlite #2167, MySQL #2180, Snowflake #2188, Hive #2189. ClickHouseColumnTypeEnum.buildDataType guarded with if (columnSize == null || decimalDigits == null), returning bare Decimal for Decimal(10) (precision set, scale null). Changed to columnSize == null only, making the size-only branch reachable. Unlike other DBs, ClickHouse Decimal requires both P and S, so the size-only branch returns Decimal(P,0) (scale defaults to 0) instead of the invalid Decimal(P).
Verification
Contributor declaration
AI assistance: The fix, verification, and PR description were produced with Claude Code assistance.