1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-21 10:42:50 +03:00

Test IsInTransactionChain, not IsTransactionBlock, in vac_update_relstats.

As noted by Noah Misch, my initial cut at fixing bug #11638 didn't cover
all cases where ANALYZE might be invoked in an unsafe context.  We need to
test the result of IsInTransactionChain not IsTransactionBlock; which is
notationally a pain because IsInTransactionChain requires an isTopLevel
flag, which would have to be passed down through several levels of callers.
I chose to pass in_outer_xact (ie, the result of IsInTransactionChain)
rather than isTopLevel per se, as that seemed marginally more apropos
for the intermediate functions to know about.
This commit is contained in:
Tom Lane
2014-10-30 13:03:22 -04:00
parent 6057c212f3
commit fd0f651a86
4 changed files with 31 additions and 20 deletions

View File

@@ -309,7 +309,8 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt,
new_rel_allvisible,
vacrelstats->hasindex,
new_frozen_xid,
new_min_multi);
new_min_multi,
false);
/* report results to the stats collector, too */
new_live_tuples = new_rel_tuples - vacrelstats->new_dead_tuples;
@@ -1377,7 +1378,8 @@ lazy_cleanup_index(Relation indrel,
0,
false,
InvalidTransactionId,
InvalidMultiXactId);
InvalidMultiXactId,
false);
ereport(elevel,
(errmsg("index \"%s\" now contains %.0f row versions in %u pages",