Skip to content

Commit 927d651

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 cc53e23 commit 927d651

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎postprocessing.c

+1-2
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)