diff --git a/contrib/babelfishpg_tsql/src/dbcmds.c b/contrib/babelfishpg_tsql/src/dbcmds.c index 21e9d9805a..132f89553c 100644 --- a/contrib/babelfishpg_tsql/src/dbcmds.c +++ b/contrib/babelfishpg_tsql/src/dbcmds.c @@ -1403,17 +1403,19 @@ grant_perms_to_dbreader_dbwriter_ddladmin(const uint16 dbid, initStringInfo(&query); appendStringInfo(&query, "GRANT SELECT ON ALL TABLES IN SCHEMA dummy TO dummy; "); appendStringInfo(&query, "GRANT INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA dummy TO dummy; "); + appendStringInfo(&query, "GRANT UPDATE ON ALL SEQUENCES IN SCHEMA dummy TO dummy; "); appendStringInfo(&query, "GRANT TRUNCATE ON ALL TABLES IN SCHEMA dummy TO dummy; "); appendStringInfo(&query, "GRANT CREATE ON SCHEMA dummy TO dummy ; "); /* Grant ALTER DEFAULT PRIVILEGES on schema owner and dbo user. */ appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT SELECT ON TABLES TO dummy; "); appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT INSERT, UPDATE, DELETE ON TABLES TO dummy; "); + appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT UPDATE ON SEQUENCES TO dummy; "); appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT TRUNCATE ON TABLES TO dummy; "); stmt_list = raw_parser(query.data, RAW_PARSE_DEFAULT); - Assert(list_length(stmt_list) == 7); + Assert(list_length(stmt_list) == 9); ScanKeyInit(&key, Anum_namespace_ext_dbid, @@ -1444,6 +1446,8 @@ grant_perms_to_dbreader_dbwriter_ddladmin(const uint16 dbid, stmts = parsetree_nth_stmt(stmt_list, i++); update_GrantStmt(stmts, schema_name, NULL, db_datawriter, NULL); stmts = parsetree_nth_stmt(stmt_list, i++); + update_GrantStmt(stmts, schema_name, NULL, db_datawriter, NULL); + stmts = parsetree_nth_stmt(stmt_list, i++); update_GrantStmt(stmts, schema_name, NULL, db_ddladmin, NULL); stmts = parsetree_nth_stmt(stmt_list, i++); update_GrantStmt(stmts, schema_name, NULL, db_ddladmin, NULL); @@ -1453,6 +1457,8 @@ grant_perms_to_dbreader_dbwriter_ddladmin(const uint16 dbid, stmts = parsetree_nth_stmt(stmt_list, i++); update_AlterDefaultPrivilegesStmt(stmts, schema_name, schema_owner, dbo_user, db_datawriter, NULL); stmts = parsetree_nth_stmt(stmt_list, i++); + update_AlterDefaultPrivilegesStmt(stmts, schema_name, schema_owner, dbo_user, db_datawriter, NULL); + stmts = parsetree_nth_stmt(stmt_list, i++); update_AlterDefaultPrivilegesStmt(stmts, schema_name, schema_owner, dbo_user, db_ddladmin, NULL); /* Run all subcommands */ diff --git a/contrib/babelfishpg_tsql/src/pltsql_utils.c b/contrib/babelfishpg_tsql/src/pltsql_utils.c index b984e345c4..6d936ef3f0 100644 --- a/contrib/babelfishpg_tsql/src/pltsql_utils.c +++ b/contrib/babelfishpg_tsql/src/pltsql_utils.c @@ -2527,7 +2527,7 @@ exec_database_roles_subcmds(const char *schema) char *schema_owner; const char *dbname = get_current_pltsql_db_name(); List *stmt_list; - int expected_stmts = 4; + int expected_stmts = 5; ListCell *parsetree_item; Node *stmts; int i=0; @@ -2550,6 +2550,7 @@ exec_database_roles_subcmds(const char *schema) appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT SELECT ON TABLES TO dummy; "); /* Grant privileges to db_datawriter */ appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT INSERT, UPDATE, DELETE ON TABLES TO dummy; "); + appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT UPDATE ON SEQUENCES TO dummy; "); /* Grant privileges to db_ddladmin */ appendStringInfo(&query, "ALTER DEFAULT PRIVILEGES FOR ROLE dummy, dummy IN SCHEMA dummy GRANT TRUNCATE ON TABLES TO dummy; "); appendStringInfo(&query, "GRANT CREATE ON SCHEMA dummy TO dummy ; "); @@ -2564,6 +2565,8 @@ exec_database_roles_subcmds(const char *schema) stmts = parsetree_nth_stmt(stmt_list, i++); update_AlterDefaultPrivilegesStmt(stmts, schema, schema_owner, dbo_role, db_datareader, NULL); + stmts = parsetree_nth_stmt(stmt_list, i++); + update_AlterDefaultPrivilegesStmt(stmts, schema, schema_owner, dbo_role, db_datawriter, NULL); stmts = parsetree_nth_stmt(stmt_list, i++); update_AlterDefaultPrivilegesStmt(stmts, schema, schema_owner, dbo_role, db_datawriter, NULL); diff --git a/test/JDBC/expected/datareader_datawriter-vu-cleanup.out b/test/JDBC/expected/datareader_datawriter-vu-cleanup.out index 1ef86d7094..43d3a1cb04 100644 --- a/test/JDBC/expected/datareader_datawriter-vu-cleanup.out +++ b/test/JDBC/expected/datareader_datawriter-vu-cleanup.out @@ -40,6 +40,33 @@ void use db_roles_db1 go +drop sequence db_roles_schema_1.before_sq1; +go + +drop sequence db_roles_schema_1.after_sq1; +go + +drop sequence db_roles_schema_1.after_sq2; +go + +drop sequence db_roles_schema_2.before_created_by_dbo_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_dbo_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_dbo_sq2; +go + +drop sequence db_roles_schema_2.before_created_by_u2_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_u2_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_u2_sq2; +go + drop table db_roles_schema_1.before_t1; go diff --git a/test/JDBC/expected/datareader_datawriter-vu-prepare.out b/test/JDBC/expected/datareader_datawriter-vu-prepare.out index e84dd65fe4..fa86724eea 100644 --- a/test/JDBC/expected/datareader_datawriter-vu-prepare.out +++ b/test/JDBC/expected/datareader_datawriter-vu-prepare.out @@ -27,12 +27,18 @@ go create table db_roles_schema_1.before_t1(a int); go +create sequence db_roles_schema_1.before_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_1.before_v1 as select 2; go create table db_roles_schema_2.before_created_by_dbo_t1(a int); go +create sequence db_roles_schema_2.before_created_by_dbo_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.before_created_by_dbo_v1 as select 2; go @@ -46,6 +52,9 @@ go create table db_roles_schema_2.before_created_by_u2_t1(a int); go +create sequence db_roles_schema_2.before_created_by_u2_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.before_created_by_u2_v1 as select 2; go diff --git a/test/JDBC/expected/datareader_datawriter-vu-verify.out b/test/JDBC/expected/datareader_datawriter-vu-verify.out index 9e332ab99b..8bda36da97 100644 --- a/test/JDBC/expected/datareader_datawriter-vu-verify.out +++ b/test/JDBC/expected/datareader_datawriter-vu-verify.out @@ -59,6 +59,9 @@ go create table db_roles_schema_2.after_created_by_u2_t1(a int); go +create sequence db_roles_schema_2.after_created_by_u2_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_u2_v1 as select 1; go @@ -72,12 +75,18 @@ go create table db_roles_schema_1.after_t1(a int); go +create sequence db_roles_schema_1.after_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_1.after_v1 as select 2; go create table db_roles_schema_2.after_created_by_dbo_t1(a int); go +create sequence db_roles_schema_2.after_created_by_dbo_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_dbo_v1 as select 2; go @@ -90,12 +99,18 @@ go create table db_roles_schema_1.after_t2(a int); go +create sequence db_roles_schema_1.after_sq2 start with 1 increment by 1 ; +go + create view db_roles_schema_1.after_v2 as select 2; go create table db_roles_schema_2.after_created_by_dbo_t2(a int); go +create sequence db_roles_schema_2.after_created_by_dbo_sq2 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_dbo_v2 as select 2; go @@ -109,6 +124,9 @@ go create table db_roles_schema_2.after_created_by_u2_t2(a int); go +create sequence db_roles_schema_2.after_created_by_u2_sq2 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_u2_v2 as select 1; go @@ -134,6 +152,22 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq1; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq2; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_1.after_v1; -- allowed go ~~START~~ @@ -150,6 +184,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_1.before_sq1; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + insert into db_roles_schema_1.before_t1 values(1); -- allowed go ~~ROW COUNT: 1~~ @@ -172,6 +214,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_dbo_sq1; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_2.before_created_by_dbo_v1; -- allowed go ~~START~~ @@ -202,6 +252,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq1; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_2.after_created_by_dbo_v1; -- allowed go ~~START~~ @@ -232,6 +290,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq2; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_2.after_created_by_dbo_v2; -- allowed go ~~START~~ @@ -262,6 +328,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_u2_sq1; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_2.before_created_by_u2_v1; -- allowed go ~~START~~ @@ -292,6 +366,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq2; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_2.after_created_by_u2_v2; -- allowed go ~~START~~ @@ -322,6 +404,14 @@ int ~~END~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq1; -- allowed +go +~~START~~ +bigint +1 +~~END~~ + + select * from db_roles_schema_2.after_created_by_u2_v1; -- allowed go ~~START~~ @@ -379,6 +469,24 @@ go ~~ERROR (Message: permission denied for table after_t2)~~ +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq1; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence after_sq1)~~ + + +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq2; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence after_sq2)~~ + + select * from db_roles_schema_1.before_t1; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -386,6 +494,15 @@ go ~~ERROR (Message: permission denied for table before_t1)~~ +SELECT NEXT VALUE FOR db_roles_schema_1.before_sq1; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence before_sq1)~~ + + select * from db_roles_schema_1.after_v1; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -477,6 +594,15 @@ go ~~ERROR (Message: permission denied for table before_created_by_dbo_t1)~~ +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_dbo_sq1; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence before_created_by_dbo_sq1)~~ + + select * from db_roles_schema_2.before_created_by_dbo_v1; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -512,6 +638,15 @@ go ~~ERROR (Message: permission denied for table after_created_by_dbo_t1)~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq1; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence after_created_by_dbo_sq1)~~ + + select * from db_roles_schema_2.after_created_by_dbo_v1; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -547,6 +682,15 @@ go ~~ERROR (Message: permission denied for table after_created_by_dbo_t2)~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq2; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence after_created_by_dbo_sq2)~~ + + select * from db_roles_schema_2.after_created_by_dbo_v2; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -582,6 +726,15 @@ go ~~ERROR (Message: permission denied for table before_created_by_u2_t1)~~ +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_u2_sq1; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence before_created_by_u2_sq1)~~ + + select * from db_roles_schema_2.before_created_by_u2_v1; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -617,6 +770,15 @@ go ~~ERROR (Message: permission denied for table after_created_by_u2_t1)~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq1; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence after_created_by_u2_sq1)~~ + + select * from db_roles_schema_2.after_created_by_u2_v1; -- not allowed go ~~ERROR (Code: 33557097)~~ @@ -652,6 +814,15 @@ go ~~ERROR (Message: permission denied for table after_created_by_u2_t2)~~ +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq2; -- not allowed +go +~~START~~ +bigint +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: permission denied for sequence after_created_by_u2_sq2)~~ + + select * from db_roles_schema_2.after_created_by_u2_v2; -- not allowed go ~~ERROR (Code: 33557097)~~ diff --git a/test/JDBC/input/datareader_datawriter-vu-cleanup.mix b/test/JDBC/input/datareader_datawriter-vu-cleanup.mix index dba3f476ba..80d46e8424 100644 --- a/test/JDBC/input/datareader_datawriter-vu-cleanup.mix +++ b/test/JDBC/input/datareader_datawriter-vu-cleanup.mix @@ -22,6 +22,33 @@ go use db_roles_db1 go +drop sequence db_roles_schema_1.before_sq1; +go + +drop sequence db_roles_schema_1.after_sq1; +go + +drop sequence db_roles_schema_1.after_sq2; +go + +drop sequence db_roles_schema_2.before_created_by_dbo_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_dbo_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_dbo_sq2; +go + +drop sequence db_roles_schema_2.before_created_by_u2_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_u2_sq1; +go + +drop sequence db_roles_schema_2.after_created_by_u2_sq2; +go + drop table db_roles_schema_1.before_t1; go diff --git a/test/JDBC/input/datareader_datawriter-vu-prepare.mix b/test/JDBC/input/datareader_datawriter-vu-prepare.mix index 05acda9627..867f0e7db8 100644 --- a/test/JDBC/input/datareader_datawriter-vu-prepare.mix +++ b/test/JDBC/input/datareader_datawriter-vu-prepare.mix @@ -27,12 +27,18 @@ go create table db_roles_schema_1.before_t1(a int); go +create sequence db_roles_schema_1.before_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_1.before_v1 as select 2; go create table db_roles_schema_2.before_created_by_dbo_t1(a int); go +create sequence db_roles_schema_2.before_created_by_dbo_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.before_created_by_dbo_v1 as select 2; go @@ -46,6 +52,9 @@ go create table db_roles_schema_2.before_created_by_u2_t1(a int); go +create sequence db_roles_schema_2.before_created_by_u2_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.before_created_by_u2_v1 as select 2; go diff --git a/test/JDBC/input/datareader_datawriter-vu-verify.mix b/test/JDBC/input/datareader_datawriter-vu-verify.mix index 055893a83e..b9c4f2c4b0 100644 --- a/test/JDBC/input/datareader_datawriter-vu-verify.mix +++ b/test/JDBC/input/datareader_datawriter-vu-verify.mix @@ -29,6 +29,9 @@ go create table db_roles_schema_2.after_created_by_u2_t1(a int); go +create sequence db_roles_schema_2.after_created_by_u2_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_u2_v1 as select 1; go @@ -42,12 +45,18 @@ go create table db_roles_schema_1.after_t1(a int); go +create sequence db_roles_schema_1.after_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_1.after_v1 as select 2; go create table db_roles_schema_2.after_created_by_dbo_t1(a int); go +create sequence db_roles_schema_2.after_created_by_dbo_sq1 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_dbo_v1 as select 2; go @@ -60,12 +69,18 @@ go create table db_roles_schema_1.after_t2(a int); go +create sequence db_roles_schema_1.after_sq2 start with 1 increment by 1 ; +go + create view db_roles_schema_1.after_v2 as select 2; go create table db_roles_schema_2.after_created_by_dbo_t2(a int); go +create sequence db_roles_schema_2.after_created_by_dbo_sq2 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_dbo_v2 as select 2; go @@ -79,6 +94,9 @@ go create table db_roles_schema_2.after_created_by_u2_t2(a int); go +create sequence db_roles_schema_2.after_created_by_u2_sq2 start with 1 increment by 1 ; +go + create view db_roles_schema_2.after_created_by_u2_v2 as select 1; go @@ -96,12 +114,21 @@ go select * from db_roles_schema_1.after_t2; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq1; -- allowed +go + +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq2; -- allowed +go + select * from db_roles_schema_1.after_v1; -- allowed go select * from db_roles_schema_1.after_v2; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_1.before_sq1; -- allowed +go + insert into db_roles_schema_1.before_t1 values(1); -- allowed go @@ -114,6 +141,9 @@ go select * from db_roles_schema_2.before_created_by_dbo_t1; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_dbo_sq1; -- allowed +go + select * from db_roles_schema_2.before_created_by_dbo_v1; -- allowed go @@ -129,6 +159,9 @@ go select * from db_roles_schema_2.after_created_by_dbo_t1; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq1; -- allowed +go + select * from db_roles_schema_2.after_created_by_dbo_v1; -- allowed go @@ -144,6 +177,9 @@ go select * from db_roles_schema_2.after_created_by_dbo_t2; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq2; -- allowed +go + select * from db_roles_schema_2.after_created_by_dbo_v2; -- allowed go @@ -159,6 +195,9 @@ go select * from db_roles_schema_2.before_created_by_u2_t1; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_u2_sq1; -- allowed +go + select * from db_roles_schema_2.before_created_by_u2_v1; -- allowed go @@ -174,6 +213,9 @@ go select * from db_roles_schema_2.after_created_by_u2_t2; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq2; -- allowed +go + select * from db_roles_schema_2.after_created_by_u2_v2; -- allowed go @@ -189,6 +231,9 @@ go select * from db_roles_schema_2.after_created_by_u2_t1; -- allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq1; -- allowed +go + select * from db_roles_schema_2.after_created_by_u2_v1; -- allowed go @@ -227,9 +272,18 @@ go select * from db_roles_schema_1.after_t2; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq1; -- not allowed +go + +SELECT NEXT VALUE FOR db_roles_schema_1.after_sq2; -- not allowed +go + select * from db_roles_schema_1.before_t1; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_1.before_sq1; -- not allowed +go + select * from db_roles_schema_1.after_v1; -- not allowed go @@ -269,6 +323,9 @@ go select * from db_roles_schema_2.before_created_by_dbo_t1; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_dbo_sq1; -- not allowed +go + select * from db_roles_schema_2.before_created_by_dbo_v1; -- not allowed go @@ -284,6 +341,9 @@ go select * from db_roles_schema_2.after_created_by_dbo_t1; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq1; -- not allowed +go + select * from db_roles_schema_2.after_created_by_dbo_v1; -- not allowed go @@ -299,6 +359,9 @@ go select * from db_roles_schema_2.after_created_by_dbo_t2; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_dbo_sq2; -- not allowed +go + select * from db_roles_schema_2.after_created_by_dbo_v2; -- not allowed go @@ -314,6 +377,9 @@ go select * from db_roles_schema_2.before_created_by_u2_t1; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.before_created_by_u2_sq1; -- not allowed +go + select * from db_roles_schema_2.before_created_by_u2_v1; -- not allowed go @@ -329,6 +395,9 @@ go select * from db_roles_schema_2.after_created_by_u2_t1; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq1; -- not allowed +go + select * from db_roles_schema_2.after_created_by_u2_v1; -- not allowed go @@ -344,6 +413,9 @@ go select * from db_roles_schema_2.after_created_by_u2_t2; -- not allowed go +SELECT NEXT VALUE FOR db_roles_schema_2.after_created_by_u2_sq2; -- not allowed +go + select * from db_roles_schema_2.after_created_by_u2_v2; -- not allowed go