Remove bogus Assert, add some regression test cases showing why.
Tom Lane <tgl@sss.pgh.pa.us>
Remove bogus Assert, add some regression test cases showing why. Commit 77ec5affb added an assertion to enforce_generic_type_consistency that boils down to "if the function result is polymorphic, there must be at least one polymorphic argument". This should be true for user-created functions, but there are built-in functions for which it's not true, as pointed out by Jaime Casanova. Hence, go back to the old behavior of leaving the return type alone. There's only a limited amount of stuff you can do with such a function result, but it does work to some extent; add some regression test cases to ensure we don't break that again. Discussion: https://postgr.es/m/CAJGNTeMbhtsCUZgJJ8h8XxAJbK7U2ipsX8wkHRtZRz-NieT8RA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/parse_coerce.c | modified | +12 −9 |
| src/test/regress/expected/polymorphism.out | modified | +13 −0 |
| src/test/regress/sql/polymorphism.sql | modified | +5 −0 |
Discussion
- Failed Assertion about PolymorphicType 2 messages · 2020-04-04