From faf5cee7f0189beba206a5d96c0abd8e4382b844 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 18 Sep 2011 23:46:04 -0400 Subject: [PATCH] Fix another Assert issue exposed by CLOBBER_CACHE_ALWAYS. plpgsql's exec_stmt_execsql was Assert'ing that a CachedPlanSource was is_valid immediately after exec_prepare_plan. The risk factor in this case is that after building the prepared statement, exec_prepare_plan calls exec_simple_check_plan, which might try to generate a generic plan --- and with CLOBBER_CACHE_ALWAYS or other unusual causes of invalidation, that could result in an invalidation. However, that path could only be taken for a SELECT query, for which we need not set mod_stmt. So in this case I think it's best to just remove the Assert; it's okay to look at a slightly-stale querytree for what we need here. Per buildfarm testing. --- src/pl/plpgsql/src/pl_exec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 1f1acdc5e0..f0ed762ccc 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -3027,7 +3027,6 @@ exec_stmt_execsql(PLpgSQL_execstate *estate, CachedPlanSource *plansource = (CachedPlanSource *) lfirst(l); ListCell *l2; - Assert(plansource->is_valid); foreach(l2, plansource->query_list) { Query *q = (Query *) lfirst(l2); -- 2.39.5