git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: f3c15cb) | patch
Fix portability issues in datetime parsing.
Sun, 3 Apr 2022 21:04:21 +0000 (17:04 -0400)
Sun, 3 Apr 2022 21:04:33 +0000 (17:04 -0400)
commit 591e088dd5b357796e136c13dfcdb1f06fd7a3c2
Fix portability issues in datetime parsing.

datetime.c's parsing logic has assumed that strtod() will accept
a string that looks like ".", which it does in glibc, but not on
some less-common platforms such as AIX. The result of this was
that datetime fields like "123." would be accepted on some platforms
but not others; which is a sufficiently odd case that it's not that
surprising we've heard no field complaints. But commit e39f99046
extended that assumption to new places, and happened to add a test
case that exposed the platform dependency. Remove this dependency
by special-casing situations without any digits after the decimal
point.

(Again, this is in part a pre-existing bug but I don't feel a
compulsion to back-patch.)

Also, rearrange e39f99046's changes in formatting.c to avoid a
Coverity complaint that we were copying an uninitialized field.

Discussion: https://postgr.es/m/1592893.1648969747@sss.pgh.pa.us
src/backend/utils/adt/datetime.c diff | blob | blame | history
src/backend/utils/adt/formatting.c diff | blob | blame | history
src/test/regress/expected/interval.out diff | blob | blame | history
src/test/regress/sql/interval.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /