pull/7436/head
Onur Tirtir 2024-01-24 13:54:06 +03:00
parent be243780d9
commit c84170da99
4 changed files with 15 additions and 16 deletions

View File

@ -521,9 +521,23 @@ char *
GetAuthinfo(char *hostname, int32 port, char *user)
{
char *authinfo = NULL;
bool isLoopback = (strncmp(LOCAL_HOST_NAME, hostname, MAX_NODE_LENGTH) == 0 &&
bool isLoopback = (strncmp(LocalHostName, hostname, MAX_NODE_LENGTH) == 0 &&
PostPortNumber == port);
/*
* Citus will not be loaded when we run a global DDL command from a
* Citus non-main database.
*/
if (!CitusHasBeenLoaded())
{
/*
* We don't expect non-main databases to connect to a node other than
* the local one.
*/
Assert(isLoopback);
return "";
}
if (IsTransactionState())
{
int64 nodeId = WILDCARD_NODE_ID;

View File

@ -5723,14 +5723,6 @@ GetPoolinfoViaCatalog(int32 nodeId)
char *
GetAuthinfoViaCatalog(const char *roleName, int64 nodeId)
{
/*
* Citus will not be loaded when we run a global DDL command from a
* Citus non-main database.
*/
if (!CitusHasBeenLoaded())
{
return "";
}
char *authinfo = "";
Datum nodeIdDatumArray[2] = {
Int32GetDatum(nodeId),

View File

@ -77,11 +77,8 @@ SET ROLE nonsuperuser;
-- Otherwise, we would get the following error:
-- ERROR: cache lookup failed for pg_dist_node, called too early?
CREATE USER other_db_user9;
ERROR: cache lookup failed for pg_dist_node, called too early?
RESET ROLE;
RESET citus.local_hostname;
SET ROLE nonsuperuser;
CREATE USER other_db_user9;
RESET ROLE;
\c regression
SELECT usename FROM pg_user WHERE usename LIKE 'other\_db\_user%' ORDER BY 1;

View File

@ -61,10 +61,6 @@ CREATE USER other_db_user9;
RESET ROLE;
RESET citus.local_hostname;
SET ROLE nonsuperuser;
CREATE USER other_db_user9;
RESET ROLE;
\c regression
SELECT usename FROM pg_user WHERE usename LIKE 'other\_db\_user%' ORDER BY 1;