Skip to content

Commit db8179b

Browse files
committed
Bugfix. Assertion on disabled query at the ExecutorEnd hook.
In an extravagant situation: (mode=disabled, forced stat gathering = 'on') we can get into a situation when AQO is disabled for a query, but previously cached plan contains some AQO preferences. Even so, we should ignore the query at the end of execution.
1 parent f17f5a9 commit db8179b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

postprocessing.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ aqo_ExecutorEnd(QueryDesc *queryDesc)
757757
cardinality_sum_errors = 0.;
758758
cardinality_num_objects = 0;
759759

760-
if (!ExtractFromQueryEnv(queryDesc))
760+
if (IsQueryDisabled() || !ExtractFromQueryEnv(queryDesc))
761761
/* AQO keep all query-related preferences at the query context.
762762
* It is needed to prevent from possible recursive changes, at
763763
* preprocessing stage of subqueries.
@@ -768,7 +768,6 @@ aqo_ExecutorEnd(QueryDesc *queryDesc)
768768

769769
njoins = (enr != NULL) ? *(int *) enr->reldata : -1;
770770

771-
Assert(!IsQueryDisabled());
772771
Assert(!IsParallelWorker());
773772

774773
if (query_context.explain_only)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy