fix: cast numeric FORMAT arguments for DuckDB - #479
Open
weicao wants to merge 1 commit into
Open
Conversation
weicao
force-pushed
the
compat/format-cast
branch
from
August 23, 2026 15:05
22a0d85 to
be3522f
Compare
Preserve integer and DECIMAL precision while translating MySQL FORMAT. Generated through the GitHub platform commit API.
weicao
force-pushed
the
compat/format-cast
branch
from
August 23, 2026 16:03
be3522f to
e5b396c
Compare
leon-ape
approved these changes
Aug 23, 2026
leon-ape
left a comment
Collaborator
There was a problem hiding this comment.
Independent review of exact platform-signed head e5b396c.
- GitHub web-flow verified; unique parent is exact main 749b616; tree ae59af41133032963be2e93a1c62c0fd9e401073.
- Scope is exactly three files: transpiler/translate.go, transpiler/translate_test.go, format_precision_test.go.
- go test ./transpiler -count=3 passed.
- Four TestQueriesSimple FORMAT cases passed 3 consecutive runs.
- TestFormatPreservesNumericPrecision passed 3 consecutive runs, including 9007199254740993 and 30-digit DECIMAL. Additional negative DECIMAL, locale, string, NULL, and dynamic-digit probes passed.
- Parent/head TestQueriesSimple comparison removed only the two intended integer FORMAT failures and introduced no new failure.
The remaining Go/binlog/Postgres CI failures match known parent baseline differences outside these files. No merge or image action performed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Fix MySQL FORMAT(x, d[, locale]) when x is an integer. DuckDB rejects precision format specifiers for integer arguments, while MySQL accepts them. The translator now casts the value to DOUBLE before formatting.
Evidence
precision not allowed for this argument type.go test ./transpilerpasses.Please platform-sign the replacement head before review. Do not merge or change release tags from this PR.