Skip to content

Commit

Permalink
Fix compiler error when using PG_TRY..PG_FINALLY
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fabriziomello committed Dec 11, 2024
1 parent 63f7cc8 commit b1eb0e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tsl/src/continuous_aggs/materialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Please see the included NOTICE for copyright information and
* LICENSE-TIMESCALE for a copy of the license.
*/
#include <compat/compat.h>
#include <postgres.h>
#include <executor/spi.h>
#include <fmgr.h>
Expand All @@ -20,6 +19,7 @@
#include <utils/snapmgr.h>
#include <utils/timestamp.h>

#include "compat/compat.h"
#include "debug_assert.h"
#include "guc.h"
#include "materialize.h"
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit b1eb0e6

Please sign in to comment.