fix(mysql): preserve DECIMAL precision when scale is null - #2181
Conversation
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 |
openai0229
left a comment
There was a problem hiding this comment.
The change still affects more MySQL type families than DECIMAL, without narrowing the implementation or adding type-by-type generated-DDL coverage. The current head does not address the detailed review comment already posted, so this remains blocked pending an updated commit and re-review.
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>
efc205a to
eb82851
Compare
|
Rebased onto latest main. Added 4 generated-DDL tests in MysqlColumnTypeEnumDecimalTest: DECIMAL(15) precision-only, DECIMAL(15,2) both, bare DECIMAL both-null, FLOAT(10) precision-only. Tests run: 4, Failures: 0. |
|
Blocking after the latest update: Please narrow the precision-only change to the intended DECIMAL variants, or add exact generated-SQL and MySQL execution tests for every affected signed and unsigned type. |
openai0229
left a comment
There was a problem hiding this comment.
Verified the MySQL type rendering fix after syncing the latest main. DECIMAL precision-only and UNSIGNED spacing are covered with exact DDL assertions, FLOAT/DOUBLE remain bare without scale, and the full MySQL reactor passed 657 tests. Required checks are passing on the current head.
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.