mirror of https://github.com/citusdata/citus.git
Merge pull request #3422 from citusdata/return-const-when-borrowing
CurrentDatabaseName: return const char* as we're borrowing from cachepull/3411/head
commit
87e6352d5b
|
@ -846,7 +846,7 @@ TrackerConnectPoll(TaskTracker *taskTracker)
|
||||||
{
|
{
|
||||||
char *nodeName = taskTracker->workerName;
|
char *nodeName = taskTracker->workerName;
|
||||||
uint32 nodePort = taskTracker->workerPort;
|
uint32 nodePort = taskTracker->workerPort;
|
||||||
char *nodeDatabase = CurrentDatabaseName();
|
const char *nodeDatabase = CurrentDatabaseName();
|
||||||
char *nodeUser = taskTracker->userName;
|
char *nodeUser = taskTracker->userName;
|
||||||
|
|
||||||
int32 connectionId = MultiClientConnectStart(nodeName, nodePort,
|
int32 connectionId = MultiClientConnectStart(nodeName, nodePort,
|
||||||
|
|
|
@ -2281,7 +2281,7 @@ CitusTableVisibleFuncId(void)
|
||||||
* one session connected to it, we do not need to implement any invalidation
|
* one session connected to it, we do not need to implement any invalidation
|
||||||
* mechanism.
|
* mechanism.
|
||||||
*/
|
*/
|
||||||
char *
|
const char *
|
||||||
CurrentDatabaseName(void)
|
CurrentDatabaseName(void)
|
||||||
{
|
{
|
||||||
if (!MetadataCache.databaseNameValid)
|
if (!MetadataCache.databaseNameValid)
|
||||||
|
|
|
@ -517,7 +517,7 @@ ExplainTaskPlacement(ShardPlacement *taskPlacement, List *explainOutputList,
|
||||||
StringInfo nodeAddress = makeStringInfo();
|
StringInfo nodeAddress = makeStringInfo();
|
||||||
char *nodeName = taskPlacement->nodeName;
|
char *nodeName = taskPlacement->nodeName;
|
||||||
uint32 nodePort = taskPlacement->nodePort;
|
uint32 nodePort = taskPlacement->nodePort;
|
||||||
char *nodeDatabase = CurrentDatabaseName();
|
const char *nodeDatabase = CurrentDatabaseName();
|
||||||
ListCell *explainOutputCell = NULL;
|
ListCell *explainOutputCell = NULL;
|
||||||
int rowIndex = 0;
|
int rowIndex = 0;
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ CreateJobSchema(StringInfo schemaName)
|
||||||
static void
|
static void
|
||||||
CreateTask(uint64 jobId, uint32 taskId, char *taskCallString)
|
CreateTask(uint64 jobId, uint32 taskId, char *taskCallString)
|
||||||
{
|
{
|
||||||
char *databaseName = CurrentDatabaseName();
|
const char *databaseName = CurrentDatabaseName();
|
||||||
char *userName = CurrentUserName();
|
char *userName = CurrentUserName();
|
||||||
|
|
||||||
/* increase task priority for cleanup tasks */
|
/* increase task priority for cleanup tasks */
|
||||||
|
|
|
@ -238,7 +238,7 @@ ReceiveRegularFile(const char *nodeName, uint32 nodePort, const char *nodeUser,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we use the same database name on the master and worker nodes */
|
/* we use the same database name on the master and worker nodes */
|
||||||
char *nodeDatabase = CurrentDatabaseName();
|
const char *nodeDatabase = CurrentDatabaseName();
|
||||||
|
|
||||||
/* connect to remote node */
|
/* connect to remote node */
|
||||||
int32 connectionId = MultiClientConnect(nodeName, nodePort, nodeDatabase, nodeUser);
|
int32 connectionId = MultiClientConnect(nodeName, nodePort, nodeDatabase, nodeUser);
|
||||||
|
|
|
@ -216,7 +216,7 @@ extern Oid BinaryCopyFormatId(void);
|
||||||
extern Oid CitusExtensionOwner(void);
|
extern Oid CitusExtensionOwner(void);
|
||||||
extern char * CitusExtensionOwnerName(void);
|
extern char * CitusExtensionOwnerName(void);
|
||||||
extern char * CurrentUserName(void);
|
extern char * CurrentUserName(void);
|
||||||
extern char * CurrentDatabaseName(void);
|
extern const char * CurrentDatabaseName(void);
|
||||||
|
|
||||||
|
|
||||||
#endif /* METADATA_CACHE_H */
|
#endif /* METADATA_CACHE_H */
|
||||||
|
|
Loading…
Reference in New Issue