Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/distributed/cdc/cdc_decoder_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ CdcExtractShardIdFromTableName(const char *tableName, bool missingOk)
char *shardIdStringEnd = NULL;

/* find the last underscore and increment for shardId string */
char *shardIdString = strrchr(tableName, SHARD_NAME_SEPARATOR);
const char *shardIdString = strrchr(tableName, SHARD_NAME_SEPARATOR);
if (shardIdString == NULL && !missingOk)
{
ereport(ERROR, (errmsg("could not extract shardId from table name \"%s\"",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/distributed/commands/multi_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@


/* constant used in binary protocol */
static const char BinarySignature[11] = "PGCOPY\n\377\r\n\0";
static const char BinarySignature[11] pg_attribute_nonstring = "PGCOPY\n\377\r\n\0";

/* if true, skip validation of JSONB columns during COPY */
bool SkipJsonbValidationInCopy = true;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/distributed/utils/citus_safe_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ SafeBsearch(const void *key, const void *ptr, rsize_t count, rsize_t size,
* does. We cannot use bsearch_s as a replacement, since it's not available
* in safestringlib.
*/
return bsearch(key, ptr, count, size, comp); /* IGNORE-BANNED */
return (void *) bsearch(key, ptr, count, size, comp); /* IGNORE-BANNED */
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ ExtractShardIdFromTableName(const char *tableName, bool missingOk)
char *shardIdStringEnd = NULL;

/* find the last underscore and increment for shardId string */
char *shardIdString = strrchr(tableName, SHARD_NAME_SEPARATOR);
const char *shardIdString = strrchr(tableName, SHARD_NAME_SEPARATOR);
if (shardIdString == NULL && !missingOk)
{
ereport(ERROR, (errmsg("could not extract shardId from table name \"%s\"",
Expand Down
13 changes: 13 additions & 0 deletions src/include/pg_version_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,4 +477,17 @@ getStxstattarget_compat(HeapTuple tup)
" MINVALUE " INT64_FORMAT " MAXVALUE " INT64_FORMAT \
" START WITH " INT64_FORMAT " CACHE " INT64_FORMAT " %sCYCLE"

/*
* pg_attribute_nonstring marks a character array that is not meant to be
* NUL-terminated, silencing -Wunterminated-string-initialization (GCC 15+).
* It was introduced in PostgreSQL 18, so provide a fallback for older versions.
*/
#ifndef pg_attribute_nonstring
#if defined(__has_attribute) && __has_attribute(nonstring)
#define pg_attribute_nonstring __attribute__((nonstring))
#else
#define pg_attribute_nonstring
#endif
#endif

#endif /* PG_VERSION_COMPAT_H */
Loading