1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Fix relcache reference leak.

Reported by Kevin Grittner.  Faulty commit identified by Tom Lane.
Patch by Amit Langote, reviewed by Michael Paquier.

Discussion: http://postgr.es/m/CACjxUsOHbH1=99u8mGxmLHfy5hov4ENEpvM6=3ARjos7wG7rtQ@mail.gmail.com
This commit is contained in:
Robert Haas
2017-03-07 11:24:51 -05:00
parent 508dabaf39
commit d88d06cd07
5 changed files with 37 additions and 2 deletions

View File

@ -1360,11 +1360,14 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
else
{
/*
* ignore, but release the lock on it. could be a partitioned
* table.
* ignore, but release the lock on it. don't try to unlock the
* passed-in relation
*/
Assert(childrel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
if (childrel != onerel)
heap_close(childrel, AccessShareLock);
else
heap_close(childrel, NoLock);
continue;
}