fix(mysql): preserve DECIMAL precision when scale is null#2181
Conversation
buildDataType guarded with columnSize == null || decimalDigits == null, returning bare DECIMAL for DECIMAL(10) (precision set, scale null). The size-only branch was unreachable dead code. Guard on columnSize only, mirroring every sibling. Same fix as Sqlite OtterMind#2167. Fixes OtterMind#2180 Co-Authored-By: Claude <noreply@anthropic.com>
Live-database verification (MySQL 8)
Before the fix: |
|
Thanks for the update. This is not ready to merge in its current form. The Please either narrow the fix to the intended types or add type-by-type automated generated-DDL tests against MySQL, including the one-argument |
Related issue
Closes #2180
Summary
MysqlColumnTypeEnum.buildDataType guarded with if (columnSize == null || decimalDigits == null), returning bare DECIMAL for DECIMAL(10) (precision set, scale null) — the precision was silently lost (MySQL defaults to DECIMAL(10,0)). The size-only branch was unreachable dead code. Changed the guard to columnSize == null only, making the size-only branch reachable. Mirrors every sibling (Oracle/DM/DB2/Oscar). Same fix as the already-merged Sqlite #2167.
Verification
Contributor declaration
AI assistance: The fix, verification, and PR description were produced with Claude Code assistance.