You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use SQL_NUMERIC_STRUCT by default for DECIMAL/NUMERIC values (#1470)
POTENTIALLY BREAKING: this changes the default behavior for fetching DECIMAL and
NUMERIC values for every connection on upgrade.
DECIMAL/NUMERIC values are now fetched via the binary SQL_NUMERIC_STRUCT
(SQL_C_NUMERIC) path by default, instead of being read as text and parsed -- the
old path guessed the locale decimal separator and produced wrong values in some
locales (#753). The binary path is locale-independent and also helps TVP numerics
(#996).
Opt out / restore the legacy string-based path per connection with:
connection.fetch_decimal_as_string = True
The string path is also used automatically as a fallback when the column scale is
outside [0, 127] (e.g. PostgreSQL's negative-scale reporting) or when descriptor
setup fails. Also fixes a missing-argument bug in the DecimalFromText fallback.
Fixes#753. Helps #996.
Note for release notes: call this out as potentially breaking, document the
fetch_decimal_as_string bypass, and note the historical driver-compatibility
caution around SQL_NUMERIC_STRUCT.
0 commit comments