Fixes review comments

pull/7204/head
gindibay 2023-09-18 22:23:26 +03:00
parent 9536ba17b3
commit 04d2e9fb2f
3 changed files with 15 additions and 8 deletions

View File

@ -164,10 +164,6 @@ AppendRoleOption(StringInfo buf, ListCell *optionCell)
{ {
appendStringInfo(buf, " CONNECTION LIMIT %d", intVal(option->arg)); appendStringInfo(buf, " CONNECTION LIMIT %d", intVal(option->arg));
} }
else if (strcmp(option->defname, "sysid") == 0)
{
appendStringInfo(buf, " SYSID %d", intVal(option->arg));
}
else if (strcmp(option->defname, "password") == 0) else if (strcmp(option->defname, "password") == 0)
{ {
if (option->arg != NULL) if (option->arg != NULL)
@ -204,10 +200,20 @@ DeparseCreateRoleStmt(Node *node)
return buf.data; return buf.data;
} }
static void
AppendSysIdStatement(StringInfo buf, ListCell *optionCell)
{
DefElem *option = (DefElem *) lfirst(optionCell);
if (strcmp(option->defname, "sysid") == 0)
{
appendStringInfo(buf, " SYSID %d", intVal(option->arg));
}
}
/* /*
* AppendRoleOption generates the string representation of the DefElem option * AppendInlinePriviliges generates the string representation for the inline
* and appends it to the buffer. * privileges of the role in create statement and appends it to the buffer.
*/ */
static void static void
AppendInlinePriviliges(StringInfo buf, ListCell *optionCell) AppendInlinePriviliges(StringInfo buf, ListCell *optionCell)
@ -277,6 +283,7 @@ AppendCreateRoleStmt(StringInfo buf, CreateRoleStmt *stmt)
{ {
AppendRoleOption(buf, optionCell); AppendRoleOption(buf, optionCell);
AppendInlinePriviliges(buf, optionCell); AppendInlinePriviliges(buf, optionCell);
AppendSysIdStatement(buf, optionCell);
} }
} }

View File

@ -405,7 +405,7 @@ NOTICE: issuing ALTER ROLE test1 RENAME TO test2;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER ROLE test1 RENAME TO test2; NOTICE: issuing ALTER ROLE test1 RENAME TO test2;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
drop user if exists test2; drop user test2;
SET citus.log_remote_commands = false; SET citus.log_remote_commands = false;
DROP TABLE test_search_path; DROP TABLE test_search_path;
DROP SCHEMA alter_role, ",CitUs,.TeeN!?", test_sp CASCADE; DROP SCHEMA alter_role, ",CitUs,.TeeN!?", test_sp CASCADE;

View File

@ -146,7 +146,7 @@ ALTER USER test1 SET random_page_cost TO 1.5;
alter user test1 rename to test2; alter user test1 rename to test2;
drop user if exists test2; drop user test2;
SET citus.log_remote_commands = false; SET citus.log_remote_commands = false;