diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-10-30 13:03:28 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-10-30 13:03:28 -0400 |
| commit | e65b550b37ec25102813d8e39eeb70f0c7944433 (patch) | |
| tree | afad536ae1e512d92dd48284d92ed595ccc7bb28 /src/include/commands | |
| parent | 81f0a5e38a05811f762b1dec9d344be923025f40 (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 0815368902c..d6139a6b4ec 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(int freeze_min_age, int freeze_table_age, int multixact_freeze_min_age, int multixact_freeze_table_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); |
