Skip to content

Commit

Permalink
Fix compiler error when using PG_TRY..PG_FINALLY (timescale#7530)
Browse files Browse the repository at this point in the history
In timescale#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
  • Loading branch information
fabriziomello authored Dec 12, 2024
1 parent af6e5a6 commit b0bd828
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 b0bd828

Please sign in to comment.