diff --git a/contrib/babelfishpg_tsql/src/rolecmds.c b/contrib/babelfishpg_tsql/src/rolecmds.c index 4e3fb8d92c..fa32eff09c 100644 --- a/contrib/babelfishpg_tsql/src/rolecmds.c +++ b/contrib/babelfishpg_tsql/src/rolecmds.c @@ -1946,7 +1946,7 @@ check_alter_server_stmt(GrantRoleStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("'sysadmin' role cannot be granted to login: a user is already created in database '%s'", db_name))); - /* Forbidden the use of fixed server principals as grantee*/ + /* Restrict adding fixed server roles as member*/ if (IS_BBF_FIXED_SERVER_ROLE(grantee_name)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), diff --git a/test/JDBC/expected/dbcreator_role-vu-verify.out b/test/JDBC/expected/dbcreator_role-vu-verify.out index f85378386f..e8f0a98cd6 100644 --- a/test/JDBC/expected/dbcreator_role-vu-verify.out +++ b/test/JDBC/expected/dbcreator_role-vu-verify.out @@ -608,6 +608,34 @@ go ~~ERROR (Message: Cannot use the special principal 'dbcreator')~~ +Alter server role dbcreator add member sysadmin +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'sysadmin')~~ + + +Alter server role securityadmin add member sysadmin +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'sysadmin')~~ + + +Alter server role dbcreator add member dbcreator +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'dbcreator')~~ + + +Alter server role sysadmin add member sysadmin +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'sysadmin')~~ + + -- terminate-tsql-conn -- tsql user=dbcreator_login1 password=123 diff --git a/test/JDBC/expected/single_db/dbcreator_role-vu-verify.out b/test/JDBC/expected/single_db/dbcreator_role-vu-verify.out index dc25ca11b7..f845656db2 100644 --- a/test/JDBC/expected/single_db/dbcreator_role-vu-verify.out +++ b/test/JDBC/expected/single_db/dbcreator_role-vu-verify.out @@ -607,6 +607,34 @@ go ~~ERROR (Message: Cannot use the special principal 'dbcreator')~~ +Alter server role dbcreator add member sysadmin +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'sysadmin')~~ + + +Alter server role securityadmin add member sysadmin +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'sysadmin')~~ + + +Alter server role dbcreator add member dbcreator +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'dbcreator')~~ + + +Alter server role sysadmin add member sysadmin +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: Cannot use the special principal 'sysadmin')~~ + + -- terminate-tsql-conn -- tsql user=dbcreator_login1 password=123 diff --git a/test/JDBC/input/dbcreator_role-vu-verify.mix b/test/JDBC/input/dbcreator_role-vu-verify.mix index ea24665acb..e5c8dafaa0 100644 --- a/test/JDBC/input/dbcreator_role-vu-verify.mix +++ b/test/JDBC/input/dbcreator_role-vu-verify.mix @@ -417,6 +417,18 @@ go Alter server role dbcreator add member dbcreator go +Alter server role dbcreator add member sysadmin +go + +Alter server role securityadmin add member sysadmin +go + +Alter server role dbcreator add member dbcreator +go + +Alter server role sysadmin add member sysadmin +go + -- terminate-tsql-conn -- tsql user=dbcreator_login1 password=123