diff --git a/src/backend/distributed/master/master_stage_protocol.c b/src/backend/distributed/master/master_stage_protocol.c index 2f964d603..d39b46446 100644 --- a/src/backend/distributed/master/master_stage_protocol.c +++ b/src/backend/distributed/master/master_stage_protocol.c @@ -839,7 +839,7 @@ WorkerShardStats(ShardPlacement *placement, Oid relationId, char *shardName, } errno = 0; - tableSize = strtoull(tableSizeString, &tableSizeStringEnd, 0); + tableSize = pg_strtouint64(tableSizeString, &tableSizeStringEnd, 0); if (errno != 0 || (*tableSizeStringEnd) != '\0') { PQclear(queryResult); diff --git a/src/backend/distributed/utils/citus_readfuncs.c b/src/backend/distributed/utils/citus_readfuncs.c index 4e8ddb1ef..a06577477 100644 --- a/src/backend/distributed/utils/citus_readfuncs.c +++ b/src/backend/distributed/utils/citus_readfuncs.c @@ -19,6 +19,7 @@ #include "distributed/multi_server_executor.h" #include "nodes/parsenodes.h" #include "nodes/readfuncs.h" +#include "utils/builtins.h" /* @@ -158,7 +159,7 @@ CitusSetTag(Node *node, int tag) #define atooid(x) ((Oid) strtoul((x), NULL, 10)) /* XXX: Citus */ -#define atoull(x) ((uint64) strtoull((x), NULL, 10)) +#define atoull(x) ((uint64) pg_strtouint64((x), NULL, 10)) #define strtobool(x) ((*(x) == 't') ? true : false) diff --git a/src/backend/distributed/worker/worker_data_fetch_protocol.c b/src/backend/distributed/worker/worker_data_fetch_protocol.c index fdb82c56c..41b1c8635 100644 --- a/src/backend/distributed/worker/worker_data_fetch_protocol.c +++ b/src/backend/distributed/worker/worker_data_fetch_protocol.c @@ -784,19 +784,14 @@ ExtractShardId(const char *tableName) } shardIdString++; -#ifdef HAVE_STRTOULL errno = 0; - shardId = strtoull(shardIdString, &shardIdStringEnd, 0); + shardId = pg_strtouint64(shardIdString, &shardIdStringEnd, 0); if (errno != 0 || (*shardIdStringEnd != '\0')) { ereport(ERROR, (errmsg("could not extract shardId from table name \"%s\"", tableName))); } -#else - ereport(ERROR, (errmsg("could not extract shardId from table name"), - errhint("Your platform does not support strtoull()"))); -#endif return shardId; }