diff options
| author | Tom Lane | 2014-10-30 17:03:22 +0000 |
|---|---|---|
| committer | Tom Lane | 2014-10-30 17:04:06 +0000 |
| commit | fd0f651a867ce4a25160e37bcb9085f3b3209bf8 (patch) | |
| tree | 0ec7c66e81f5df5621ab8873242245cba206ea83 /src/include/commands | |
| parent | 6057c212f3e783c45e050a78d070edf3e5f069f0 (diff) | |
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.
Diffstat (limited to 'src/include/commands')
| -rw-r--r-- | src/include/commands/vacuum.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index d33552a34b5..59252e40b28 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -156,7 +156,8 @@ extern void vac_update_relstats(Relation relation, BlockNumber num_all_visible_pages, bool hasindex, TransactionId frozenxid, - MultiXactId minmulti); + MultiXactId minmulti, + bool in_outer_xact); extern void vacuum_set_xid_limits(Relation rel, int freeze_min_age, int freeze_table_age, int multixact_freeze_min_age, @@ -175,7 +176,7 @@ extern void lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt, /* in commands/analyze.c */ extern void analyze_rel(Oid relid, VacuumStmt *vacstmt, - BufferAccessStrategy bstrategy); + bool in_outer_xact, BufferAccessStrategy bstrategy); extern bool std_typanalyze(VacAttrStats *stats); extern double anl_random_fract(void); extern double anl_init_selection_state(int n); |
