Skip to content

Commit

Permalink
Used sysadmin query in place of superuser query in server_principals …
Browse files Browse the repository at this point in the history
…testfile (#1964)

Fixed test failures Major Version Upgrade Tests and JDBC test which was because superuser command is not working so instead used sysadmin to add logins as the member of the sysadmin.

Signed-off-by: ANJU BHARTI <[email protected]>
  • Loading branch information
anju15bharti authored Oct 27, 2023
1 parent 7ec8b6c commit acd6756
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
5 changes: 0 additions & 5 deletions test/JDBC/expected/sys-server_principals-vu-cleanup.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
DROP LOGIN sys_server_principals_vu_login_without_sa
GO

-- psql
ALTER USER sys_server_principals_vu_login_with_sa WITH NOSUPERUSER
GO

-- tsql
DROP LOGIN sys_server_principals_vu_login_with_sa
GO
4 changes: 0 additions & 4 deletions test/JDBC/expected/sys-server_principals-vu-prepare.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ GO

CREATE LOGIN sys_server_principals_vu_login_with_sa with password = '123'
GO

-- psql
ALTER USER sys_server_principals_vu_login_with_sa WITH SUPERUSER
GO
7 changes: 7 additions & 0 deletions test/JDBC/expected/sys-server_principals-vu-verify.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
-- tsql
ALTER ROLE sysadmin add member sys_server_principals_vu_login_with_sa
GO

SELECT COUNT(*) FROM sys.all_columns WHERE object_id = object_id('sys.server_principals');
GO
~~START~~
Expand Down Expand Up @@ -77,3 +80,7 @@ sys_server_principals_vu_login_with_sa#!#S#!#SQL_LOGIN#!#master#!#English#!#-1#!
sys_server_principals_vu_login_without_sa#!#S#!#SQL_LOGIN#!#master#!#English#!#-1#!#-1#!#0
~~END~~


--tsql
ALTER ROLE sysadmin drop member sys_server_principals_vu_login_with_sa
GO
5 changes: 0 additions & 5 deletions test/JDBC/input/sys-server_principals-vu-cleanup.mix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
DROP LOGIN sys_server_principals_vu_login_without_sa
GO

-- psql
ALTER USER sys_server_principals_vu_login_with_sa WITH NOSUPERUSER
GO

-- tsql
DROP LOGIN sys_server_principals_vu_login_with_sa
GO
4 changes: 0 additions & 4 deletions test/JDBC/input/sys-server_principals-vu-prepare.mix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ CREATE LOGIN sys_server_principals_vu_login_without_sa with password = '123'
GO

CREATE LOGIN sys_server_principals_vu_login_with_sa with password = '123'
GO

-- psql
ALTER USER sys_server_principals_vu_login_with_sa WITH SUPERUSER
GO
7 changes: 7 additions & 0 deletions test/JDBC/input/sys-server_principals-vu-verify.mix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
-- tsql
ALTER ROLE sysadmin add member sys_server_principals_vu_login_with_sa
GO

SELECT COUNT(*) FROM sys.all_columns WHERE object_id = object_id('sys.server_principals');
GO

Expand Down Expand Up @@ -39,3 +42,7 @@ GO
SELECT name, type, type_desc, default_database_name, default_language_name, credential_id, owning_principal_id, is_fixed_role
FROM sys.server_principals name WHERE name like 'sys_server_principals_vu_login%' ORDER BY name;
GO

--tsql
ALTER ROLE sysadmin drop member sys_server_principals_vu_login_with_sa
GO

0 comments on commit acd6756

Please sign in to comment.