Fix hash_array
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 15 Sep 2021 09:59:34 +0000 (11:59 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 15 Sep 2021 10:15:04 +0000 (12:15 +0200)
commit851ff9335742d22a3cb1a5ab789208e4ee01dcef
tree10d5849ab8508dd08bb4ee7c4886fe53fbf9f5c2
parent379591fecf7c1011b72ddc0ffceae7a3f18b8320
Fix hash_array

Commit a3d2b1bbe904b0ca8d9fdde20f25295ff3e21f79 neglected to
initialize the type_id field of the synthesized type cache entry, so
it would make a new one on every call.

Also, better use the per-function memory context for this; otherwise
it leaks memory.

Discussion: https://www.postgresql.org/message-id/flat/17158-8a2ba823982537a4%40postgresql.org
src/backend/utils/adt/arrayfuncs.c