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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6363488) | patch
Fix CheckAttributeType's handling of collations for ranges.
2020年1月31日 22:03:55 +0000 (17:03 -0500)
2020年1月31日 22:03:55 +0000 (17:03 -0500)
commit 25dc267a1be573c36c4e40dce651ae462f17eb9e
Fix CheckAttributeType's handling of collations for ranges.

Commit fc7695891 changed CheckAttributeType to recurse into ranges,
but made it pass down the wrong collation (always InvalidOid, since
ranges as such have no collation). This would result in guaranteed
failure when considering a range type whose subtype is collatable.

Embarrassingly, we lack any regression tests that would expose such
a problem (but fortunately, somebody noticed before we shipped this
bug in any release).

Fix it to pass down the range's subtype collation property instead,
and add some regression test cases to exercise collatable-subtype
ranges a bit more. Back-patch to all supported branches, as the
previous patch was.

Report and patch by Julien Rouhaud, test cases tweaked by me

Discussion: https://postgr.es/m/CAOBaU_aBWqNweiGUFX0guzBKkcfJ8mnnyyGC_KBQmO12Mj5f_A@mail.gmail.com
src/backend/catalog/heap.c diff | blob | blame | history
src/backend/utils/cache/lsyscache.c diff | blob | blame | history
src/include/utils/lsyscache.h diff | blob | blame | history
src/test/regress/expected/rangetypes.out diff | blob | blame | history
src/test/regress/expected/sanity_check.out diff | blob | blame | history
src/test/regress/sql/rangetypes.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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