Skip to content

Commit

Permalink
reset login password in testfile
Browse files Browse the repository at this point in the history
Signed-off-by: ANJU BHARTI <[email protected]>
  • Loading branch information
ANJU BHARTI committed Oct 18, 2023
1 parent 80ecf91 commit 73f3810
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 19 deletions.
18 changes: 9 additions & 9 deletions test/JDBC/expected/sys_server_role_members-vu-prepare.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ GO
CREATE LOGIN sys_server_role_members_vu_prepare_login4 WITH PASSWORD = '123';
GO

CREATE LOGIN sys_server_role_members_vu_prepare_without_sa WITH PASSWORD = '123';
GO

CREATE USER sys_server_role_members_vu_prepare_without_sa for login sys_server_role_members_vu_prepare_without_sa;
GO

CREATE VIEW sys_server_role_members_vu_prepare_view AS
SELECT
roles.name AS RolePrincipalName
Expand All @@ -19,7 +25,7 @@ FROM sys.server_role_members AS server_role_members
INNER JOIN sys.server_principals AS roles
ON server_role_members.role_principal_id = roles.principal_id
INNER JOIN sys.server_principals AS members
ON server_role_members.member_principal_id = members.principal_id;
ON server_role_members.member_principal_id = members.principal_id order by MemberPrincipalName;
GO

CREATE FUNCTION sys_server_role_members_vu_prepare_func ()
Expand All @@ -33,7 +39,7 @@ RETURN (
INNER JOIN sys.server_principals AS roles
ON server_role_members.role_principal_id = roles.principal_id
INNER JOIN sys.server_principals AS members
ON server_role_members.member_principal_id = members.principal_id
ON server_role_members.member_principal_id = members.principal_id order by MemberPrincipalName
);
GO

Expand All @@ -47,12 +53,6 @@ BEGIN
INNER JOIN sys.server_principals AS roles
ON server_role_members.role_principal_id = roles.principal_id
INNER JOIN sys.server_principals AS members
ON server_role_members.member_principal_id = members.principal_id;
ON server_role_members.member_principal_id = members.principal_id order by MemberPrincipalName;
END;
GO

CREATE LOGIN sys_server_role_members_vu_prepare_without_sa WITH PASSWORD = '123';
GO

CREATE USER sys_server_role_members_vu_prepare_without_sa for login sys_server_role_members_vu_prepare_without_sa;
GO
8 changes: 8 additions & 0 deletions test/JDBC/expected/sys_server_role_members-vu-verify.out
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ GO
GRANT EXECUTE ON sys_server_role_members_vu_prepare_func TO sys_server_role_members_vu_prepare_without_sa;
GO

-- reset the login password
ALTER LOGIN sys_server_role_members_vu_prepare_without_sa WITH PASSWORD = '123';
GO

-- tsql user=sys_server_role_members_vu_prepare_without_sa password=123

SELECT * FROM sys_server_role_members_vu_prepare_view;
Expand All @@ -70,6 +74,10 @@ varchar#!#varchar
~~END~~


-- psql
ALTER USER sys_server_role_members_vu_prepare_login1 PASSWORD '123';
GO

-- tsql user=sys_server_role_members_vu_prepare_login1 password=123
SELECT * from sys_server_role_members_vu_prepare_view;
GO
Expand Down
20 changes: 10 additions & 10 deletions test/JDBC/input/ownership/sys_server_role_members-vu-prepare.mix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ GO
CREATE LOGIN sys_server_role_members_vu_prepare_login4 WITH PASSWORD = '123';
GO

CREATE LOGIN sys_server_role_members_vu_prepare_without_sa WITH PASSWORD = '123';
GO

CREATE USER sys_server_role_members_vu_prepare_without_sa for login sys_server_role_members_vu_prepare_without_sa;
GO

CREATE VIEW sys_server_role_members_vu_prepare_view AS
SELECT
roles.name AS RolePrincipalName
Expand All @@ -19,7 +25,7 @@ FROM sys.server_role_members AS server_role_members
INNER JOIN sys.server_principals AS roles
ON server_role_members.role_principal_id = roles.principal_id
INNER JOIN sys.server_principals AS members
ON server_role_members.member_principal_id = members.principal_id;
ON server_role_members.member_principal_id = members.principal_id order by MemberPrincipalName;
GO

CREATE FUNCTION sys_server_role_members_vu_prepare_func ()
Expand All @@ -33,7 +39,7 @@ RETURN (
INNER JOIN sys.server_principals AS roles
ON server_role_members.role_principal_id = roles.principal_id
INNER JOIN sys.server_principals AS members
ON server_role_members.member_principal_id = members.principal_id
ON server_role_members.member_principal_id = members.principal_id order by MemberPrincipalName
);
GO

Expand All @@ -47,12 +53,6 @@ BEGIN
INNER JOIN sys.server_principals AS roles
ON server_role_members.role_principal_id = roles.principal_id
INNER JOIN sys.server_principals AS members
ON server_role_members.member_principal_id = members.principal_id;
ON server_role_members.member_principal_id = members.principal_id order by MemberPrincipalName;
END;
GO

CREATE LOGIN sys_server_role_members_vu_prepare_without_sa WITH PASSWORD = '123';
GO

CREATE USER sys_server_role_members_vu_prepare_without_sa for login sys_server_role_members_vu_prepare_without_sa;
GO
GO
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ GO
GRANT EXECUTE ON sys_server_role_members_vu_prepare_func TO sys_server_role_members_vu_prepare_without_sa;
GO

-- reset the login password
ALTER LOGIN sys_server_role_members_vu_prepare_without_sa WITH PASSWORD = '123';
GO

-- tsql user=sys_server_role_members_vu_prepare_without_sa password=123

SELECT * FROM sys_server_role_members_vu_prepare_view;
Expand All @@ -38,6 +42,10 @@ GO
SELECT * FROM sys_server_role_members_vu_prepare_func();
GO

-- psql
ALTER USER sys_server_role_members_vu_prepare_login1 PASSWORD '123';
GO

-- tsql user=sys_server_role_members_vu_prepare_login1 password=123
SELECT * from sys_server_role_members_vu_prepare_view;
GO
Expand Down

0 comments on commit 73f3810

Please sign in to comment.