From 84e2a82a91b5bcd770ab4190b8ddd30ac30f2a23 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Fri, 20 Dec 2024 09:10:42 +0100 Subject: [PATCH] Fix ABI build failure in recompress.c The variable `attname` is only used in an assertion, causing warnings (or errors) when not built with assertions. --- tsl/src/compression/recompress.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tsl/src/compression/recompress.c b/tsl/src/compression/recompress.c index 237005af153..33b26543bae 100644 --- a/tsl/src/compression/recompress.c +++ b/tsl/src/compression/recompress.c @@ -685,7 +685,12 @@ create_segmentby_scankeys(CompressionSettings *settings, Relation index_rel, { AttrNumber idx_attnum = AttrOffsetGetAttrNumber(i); AttrNumber in_attnum = index_rel->rd_index->indkey.values[i]; +#ifdef USE_ASSERT_CHECKING + /* Compiler cannot figure out if attnumAttName() has any side effects, + * so we do not use pg_attribute_unused() and instead exclude the code when not using the + * assert below. */ const NameData *attname = attnumAttName(compressed_chunk_rel, in_attnum); +#endif Assert(strcmp(NameStr(*attname), ts_array_get_element_text(settings->fd.segmentby, i + 1)) == 0);