Skip to content

Commit

Permalink
making unique names for login and user
Browse files Browse the repository at this point in the history
Signed-off-by: Tanya Gupta <[email protected]>
  • Loading branch information
Tanya Gupta committed Sep 25, 2024
1 parent c152e39 commit 7e3b2f2
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions test/JDBC/expected/sys-views-vu-cleanup.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ GO
DROP VIEW sys_views_vu_prepare_t1;
GO

DROP view s1.v1 ;
DROP view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 ;
GO

DROP schema s1;
DROP schema sys_views_vu_prepare_s1;
GO

DROP login l1;
DROP login sys_views_login_l1;
GO

USE master;
Expand Down
8 changes: 4 additions & 4 deletions test/JDBC/expected/sys-views-vu-prepare.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ GO
CREATE VIEW sys_views_vu_prepare_t1 AS select 1;
GO

CREATE schema s1;
CREATE schema sys_views_vu_prepare_s1;
GO

create view s1.v1 as select 1;
create view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 as select 1;
GO

create login l1 WITH PASSWORD = '12345678';
create login sys_views_login_l1 WITH PASSWORD = '12345678';
GO

create user u1 for login l1;
create user sys_views_user_u1 for login sys_views_login_l1;
GO

USE master;
Expand Down
18 changes: 9 additions & 9 deletions test/JDBC/expected/sys-views-vu-verify.out
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ int
~~END~~


-- tsql user=l1 password=12345678
-- tsql user=sys_views_login_l1 password=12345678
USE sys_views_vu_prepare_db1;
GO

#view s1.v1 should not be visible in db1 database to l1.
select count(*) from sys.views where name = 'v1';
#view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 should not be visible in db1 database to sys_views_login_l1.
select count(*) from sys.views where name = 'sys_views_vu_prepare_v1';
GO
~~START~~
int
0
~~END~~


SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'v1';
SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'sys_views_vu_prepare_v1';
GO
~~START~~
int
Expand All @@ -139,23 +139,23 @@ int
use sys_views_vu_prepare_db1;
GO

GRANT select on schema::s1 to u1;
GRANT select on schema::sys_views_vu_prepare_s1 to sys_views_user_u1;
GO

-- tsql user=l1 password=12345678
-- tsql user=sys_views_login_l1 password=12345678
USE sys_views_vu_prepare_db1;
GO

# view s1.v1 should be visible in db1 database to l1 now.
select count(*) from sys.views where name = 'v1';
# view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 should be visible in db1 database to sys_views_login_l1 now.
select count(*) from sys.views where name = 'sys_views_vu_prepare_v1';
GO
~~START~~
int
1
~~END~~


SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'v1';
SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'sys_views_vu_prepare_v1';
GO
~~START~~
int
Expand Down
6 changes: 3 additions & 3 deletions test/JDBC/input/views/sys-views-vu-cleanup.mix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ GO
DROP VIEW sys_views_vu_prepare_t1;
GO

DROP view s1.v1 ;
DROP view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 ;
GO

DROP schema s1;
DROP schema sys_views_vu_prepare_s1;
GO

DROP login l1;
DROP login sys_views_login_l1;
GO

USE master;
Expand Down
8 changes: 4 additions & 4 deletions test/JDBC/input/views/sys-views-vu-prepare.mix
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ GO
CREATE VIEW sys_views_vu_prepare_t1 AS select 1;
GO

CREATE schema s1;
CREATE schema sys_views_vu_prepare_s1;
GO

create view s1.v1 as select 1;
create view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 as select 1;
GO

create login l1 WITH PASSWORD = '12345678';
create login sys_views_login_l1 WITH PASSWORD = '12345678';
GO

create user u1 for login l1;
create user sys_views_user_u1 for login sys_views_login_l1;
GO

USE master;
Expand Down
18 changes: 9 additions & 9 deletions test/JDBC/input/views/sys-views-vu-verify.mix
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,31 @@ GO
SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'sys_views_vu_prepare_t2';
GO

-- tsql user=l1 password=12345678
-- tsql user=sys_views_login_l1 password=12345678
USE sys_views_vu_prepare_db1;
GO

#view s1.v1 should not be visible in db1 database to l1.
select count(*) from sys.views where name = 'v1';
#view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 should not be visible in db1 database to sys_views_login_l1.
select count(*) from sys.views where name = 'sys_views_vu_prepare_v1';
GO

SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'v1';
SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'sys_views_vu_prepare_v1';
GO

-- tsql
use sys_views_vu_prepare_db1;
GO

GRANT select on schema::s1 to u1;
GRANT select on schema::sys_views_vu_prepare_s1 to sys_views_user_u1;
GO

-- tsql user=l1 password=12345678
-- tsql user=sys_views_login_l1 password=12345678
USE sys_views_vu_prepare_db1;
GO

# view s1.v1 should be visible in db1 database to l1 now.
select count(*) from sys.views where name = 'v1';
# view sys_views_vu_prepare_s1.sys_views_vu_prepare_v1 should be visible in db1 database to sys_views_login_l1 now.
select count(*) from sys.views where name = 'sys_views_vu_prepare_v1';
GO

SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'v1';
SELECT COUNT(*) FROM sys.all_objects WHERE type='V' and name = 'sys_views_vu_prepare_v1';
GO

0 comments on commit 7e3b2f2

Please sign in to comment.