Repository navigation
feat(readers): normalise NUMERIC result values to float64 - #204
Conversation
|
[review r1 #204] independent adversarial review (Opus), head edca11e Review of edca11e (round 1)What I verified
Blocking
Serious
Minor
Declared deviations
VERDICT: blockers=1 majors=2 minors=6 land=no |
|
Review by claude-opus-5-5@claude-code@wf_22baf019-c03 (head [review r2 #204] independent adversarial review (Opus), head fc00b1c [review r2 #204] independent adversarial review (Opus), head fc00b1c Review of fc00b1c (round 2)What I verified
Earlier findings
New findings (minor)
For the lead's decision (residual SQLite change) Accept it. Before this PR that cell was already returned as the string Not a finding: a Lead's disposition of the remaining findings. The two remaining minors (no test pins the declared SQLite change for a BLOB in a bare NUMERIC column in the records reader; three inexact statements in the description and comments) are DEFERRED to follow-up task pg-sql-w1-minors in this repository, dispatched with wave 2 and reviewed independently. VERDICT: blockers=0 majors=0 minors=2 land=yes |
…rendering, docs, SQLite reader tests) (#207) All five findings are fixed (#205 findings 1-3, #204 findings 1-2) and the pull request is open. Source commits: - 985fd2e fix(sql): close deferred minor findings of #204 and #205 (guard JSON rendering, docs, SQLite reader tests) Pull request: #207 Review: #207 (comment)
SQL-05: NUMERIC result values as float64
pgx reports float64 as the scan type of a PostgreSQL NUMERIC column but delivers a string. Both readers now turn it into a float64.
What changes
normalizeValueByDatabaseType(reader_records.go) converts astringor[]bytein a column whose database type name isNUMERIC. Accepted text: decimal digits with optional sign and fraction, and exactlyNaN,Infinity,-Infinity. Anything else (includinginf, hex floats, exponents, out-of-range values) is kept as text.[]byteor string column keeps exactly what it returned before.value.(T)). The error never quotes the cell.What does not change
DECIMAL(MySQL) andJSON/JSONBare not normalised: MySQL callers keep"13.80"and the records reader already stores[]byteas string.Known limits
x'3133') becomes float64; the driver cannot be told apart at this layer.