Skip to content

Commit

Permalink
Fix ABI build failure in recompress.c
Browse files Browse the repository at this point in the history
The variable `attname` is only used in an assertion, causing warnings
(or errors) when not built with assertions.
  • Loading branch information
mkindahl committed Dec 20, 2024
1 parent b01d832 commit 84e2a82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tsl/src/compression/recompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 84e2a82

Please sign in to comment.