From b0bd8284c4629f8702867c571a13bcaa5025f06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabr=C3=ADzio=20de=20Royes=20Mello?= Date: Thu, 12 Dec 2024 08:31:01 -0300 Subject: [PATCH] Fix compiler error when using PG_TRY..PG_FINALLY (#7530) In #7505 we used PG_TRY() .. PG_FINALLY() but some CI configurations was not happy with it reporting "variable might be clobbered by longjmp". Fixed it by using PG_TRY() .. PG_CATCH() instead. https://github.com/timescale/timescaledb/actions/runs/12277548387/job/34257269473#step:13:206 Disable-check: force-changelog-file --- tsl/src/continuous_aggs/materialize.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tsl/src/continuous_aggs/materialize.c b/tsl/src/continuous_aggs/materialize.c index 3fe6e0434bd..40ed1524201 100644 --- a/tsl/src/continuous_aggs/materialize.c +++ b/tsl/src/continuous_aggs/materialize.c @@ -3,7 +3,6 @@ * Please see the included NOTICE for copyright information and * LICENSE-TIMESCALE for a copy of the license. */ -#include #include #include #include @@ -20,6 +19,7 @@ #include #include +#include "compat/compat.h" #include "debug_assert.h" #include "guc.h" #include "materialize.h" @@ -770,11 +770,15 @@ execute_materializations(MaterializationContext *context) rows_processed += execute_materialization_plan(context, PLAN_TYPE_DELETE); rows_processed += execute_materialization_plan(context, PLAN_TYPE_INSERT); } + + /* Free all cached plans */ + free_materialization_plans(context); } - PG_FINALLY(); + PG_CATCH(); { /* Make sure all cached plans in the session be released before rethrowing the error */ free_materialization_plans(context); + PG_RE_THROW(); } PG_END_TRY();