pgsql: Fix CheckAttributeType's handling of collations for ranges.
От | Tom Lane |
---|---|
Тема | pgsql: Fix CheckAttributeType's handling of collations for ranges. |
Дата | |
Msg-id | E1ixeOs-0001Y9-E2@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
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 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/65aa155135a5c7c913bcb042c51d72eaad53582f Modified Files -------------- src/backend/catalog/heap.c | 3 +- src/backend/utils/cache/lsyscache.c | 26 +++++++++ src/include/utils/lsyscache.h | 1 + src/test/regress/expected/rangetypes.out | 89 +++++++++++++++++++++++++++++- src/test/regress/expected/sanity_check.out | 2 + src/test/regress/sql/rangetypes.sql | 30 +++++++++- 6 files changed, 148 insertions(+), 3 deletions(-)
В списке pgsql-committers по дате отправления: