mirror of https://github.com/citusdata/citus.git
Merge pull request #1818 from citusdata/remove-strtoull-ifdef
Remove an ifdef surrounding strtoullpull/1806/head
commit
6862cd066e
|
@ -839,7 +839,7 @@ WorkerShardStats(ShardPlacement *placement, Oid relationId, char *shardName,
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
tableSize = strtoull(tableSizeString, &tableSizeStringEnd, 0);
|
tableSize = pg_strtouint64(tableSizeString, &tableSizeStringEnd, 0);
|
||||||
if (errno != 0 || (*tableSizeStringEnd) != '\0')
|
if (errno != 0 || (*tableSizeStringEnd) != '\0')
|
||||||
{
|
{
|
||||||
PQclear(queryResult);
|
PQclear(queryResult);
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "distributed/multi_server_executor.h"
|
#include "distributed/multi_server_executor.h"
|
||||||
#include "nodes/parsenodes.h"
|
#include "nodes/parsenodes.h"
|
||||||
#include "nodes/readfuncs.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))
|
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
|
||||||
|
|
||||||
/* XXX: Citus */
|
/* 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)
|
#define strtobool(x) ((*(x) == 't') ? true : false)
|
||||||
|
|
||||||
|
|
|
@ -784,19 +784,14 @@ ExtractShardId(const char *tableName)
|
||||||
}
|
}
|
||||||
shardIdString++;
|
shardIdString++;
|
||||||
|
|
||||||
#ifdef HAVE_STRTOULL
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
shardId = strtoull(shardIdString, &shardIdStringEnd, 0);
|
shardId = pg_strtouint64(shardIdString, &shardIdStringEnd, 0);
|
||||||
|
|
||||||
if (errno != 0 || (*shardIdStringEnd != '\0'))
|
if (errno != 0 || (*shardIdStringEnd != '\0'))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("could not extract shardId from table name \"%s\"",
|
ereport(ERROR, (errmsg("could not extract shardId from table name \"%s\"",
|
||||||
tableName)));
|
tableName)));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
ereport(ERROR, (errmsg("could not extract shardId from table name"),
|
|
||||||
errhint("Your platform does not support strtoull()")));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return shardId;
|
return shardId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue