pgsql: Fix missed ReleaseVariableStats() in intarray's _int_matchsel(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix missed ReleaseVariableStats() in intarray's _int_matchsel().
Date
Msg-id E1wRdac-00172B-0d@gemulon.postgresql.org
Whole thread
List pgsql-committers
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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/273be484aadd03b8f8d45dd3aa6768ab4512d702

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 3 +++
1 file changed, 3 insertions(+)


pgsql-committers by date:

Previous
From: Fujii Masao
Date:
Subject: pgsql: postgres_fdw: Give user mapping precedence for use_scram_passthr
Next
From: Michael Paquier
Date:
Subject: pgsql: Adjust some error hints