]> granicus.if.org Git - postgresql/commit
Test IsInTransactionChain, not IsTransactionBlock, in vac_update_relstats.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Oct 2014 17:03:39 +0000 (13:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Oct 2014 17:03:39 +0000 (13:03 -0400)
commit73f950fc88eee13192ee538863b76603b030f1c0
treeb067fe310063c7e3b61a1eb210c3434c9cc8f40b
parent9d06da58e53c032ae5d4e1fdb1da533c49d3e117
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.
src/backend/commands/analyze.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/include/commands/vacuum.h