]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix missed ReleaseVariableStats() in intarray's _int_matchsel().
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 25 May 2026 22:15:49 +0000 (18:15 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 25 May 2026 22:15:49 +0000 (18:15 -0400)
commit273be484aadd03b8f8d45dd3aa6768ab4512d702
tree16792d6970c1ae295b266a7d9aa124c7c2b6ad3b
parent0445c7667e3c45eb8c3bafa4bb0ffbdc090d75e9
Fix missed ReleaseVariableStats() in intarray's _int_matchsel().

Given a WHERE clause like "int[] @@ query_int" or "query_int ~~ int[]"
where the query_int side is a table column having statistics,
_int_matchsel() exited without remembering to free the statistics
tuple.  This would typically lead to warnings about cache refcount
leakage, like
  WARNING:  resource was not closed: cache pg_statistic (73), tuple 42/12 has count 1
It's been wrong since this code was added, in commit c6fbe6d6f.

Bug: #19492
Reported-by: Man Zeng <zengman@halodbtech.com>
Author: Man Zeng <zengman@halodbtech.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19492-ddcd0e22399ef85a@postgresql.org
Backpatch-through: 14
contrib/intarray/_int_selfuncs.c