Grant test: simple grant SelectPrivCheck: select * from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) Grant test: all privileges, multiple users (2) SelectPrivCheck: select * from S2.T1 SelectPrivCheck: select count(*) from "S2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) DeletePrivCheck: delete from "S2"."T1" InsertPrivCheck: insert into "S2"."T1" values(0,0,0) UpdatePrivCheck: update S2.T1 set C1=0 UpdatePrivCheck: update S2.T1 set C2=0 UpdatePrivCheck: update S2.T1 set C3=0 TriggerPrivCheck: create trigger "T1Trig" after insert on "S2"."T1" for each row mode db2sql values 1 SelectPrivCheck: select * from S2.T1 SelectPrivCheck: select count(*) from "S2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) DeletePrivCheck: delete from "S2"."T1" InsertPrivCheck: insert into "S2"."T1" values(0,0,0) UpdatePrivCheck: update S2.T1 set C1=0 UpdatePrivCheck: update S2.T1 set C2=0 UpdatePrivCheck: update S2.T1 set C3=0 TriggerPrivCheck: create trigger "T1Trig" after insert on "S2"."T1" for each row mode db2sql values 1 SelectPrivCheck: select * from S2.T1 SelectPrivCheck: select count(*) from "S2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) DeletePrivCheck: delete from "S2"."T1" InsertPrivCheck: insert into "S2"."T1" values(0,0,0) UpdatePrivCheck: update S2.T1 set C1=0 UpdatePrivCheck: update S2.T1 set C2=0 UpdatePrivCheck: update S2.T1 set C3=0 TriggerPrivCheck: create trigger "T1Trig" after insert on "S2"."T1" for each row mode db2sql values 1 SelectPrivCheck: select * from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from S2.T2 SelectPrivCheck: select count(*) from "S2"."T2" where (C1 is null) or (C2 is null) or (C3 is null) Grant test: Column privileges SelectPrivCheck: select C1 from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C1 is null) SelectPrivCheck: select C2 from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C2 is null) SelectPrivCheck: select C3 from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C3 is null) SelectPrivCheck: select * from S1.T1 SelectPrivCheck: select count(*) from "S1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) UpdatePrivCheck: update S1.T1 set C2=0 UpdatePrivCheck: update S1.T1 set C3=0 UpdatePrivCheck: update S1.T1 set C1=0 Grant test: execute on function with like named procedure ExecutePrivCheck: values "S1"."F1"() ExecutePrivCheck: call "S1"."F1"() ExecutePrivCheck: values "S1"."F1"() Grant test: execute on procedure ExecutePrivCheck: call "S1"."P1"() ExecutePrivCheck: call "S1"."P1"() Grant test: PUBLIC table privileges SelectPrivCheck: select * from S2.T2 SelectPrivCheck: select count(*) from "S2"."T2" where (C1 is null) or (C2 is null) or (C3 is null) Grant test: PUBLIC routine privileges ExecutePrivCheck: call "S1"."P1"() ExecutePrivCheck: call "S1"."P1"() Test grant rollback and commit Grant test: table privileges in transaction Grant test: table privileges in transaction Grant test: routine privileges in transaction SelectPrivCheck: select C2 from S2.T3 SelectPrivCheck: select count(*) from "S2"."T3" where (C2 is null) DeletePrivCheck: delete from "S2"."T3" ExecutePrivCheck: values "S2"."F1"() Grant test: table privileges in transaction Grant test: table privileges in transaction Grant test: routine privileges in transaction SelectPrivCheck: select C2 from S2.T3 SelectPrivCheck: select count(*) from "S2"."T3" where (C2 is null) DeletePrivCheck: delete from "S2"."T3" ExecutePrivCheck: values "S2"."F1"() Test metadata supports methods. SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select C2 from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C2 is null) UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C3=0 ExecutePrivCheck: call "R1"."P1"() Revoke test: all with no permissions SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select C2 from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C2 is null) UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C3=0 ExecutePrivCheck: call "R1"."P1"() Revoke test: execute with no permissions SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select C2 from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C2 is null) UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C3=0 ExecutePrivCheck: call "R1"."P1"() Revoke test: column with no permissions SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select C2 from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C2 is null) UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C3=0 ExecutePrivCheck: call "R1"."P1"() Revoke test: single table privilege, one user SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C2=0 UpdatePrivCheck: update R2.T1 set C3=0 UpdatePrivCheck: update R2.T1 set C3=0 InsertPrivCheck: insert into "R2"."T1" values(0,0,0) DeletePrivCheck: delete from "R2"."T1" TriggerPrivCheck: create trigger "T1Trig" after insert on "R2"."T1" for each row mode db2sql values 1 Revoke test: single table privilege, one user SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C2=0 UpdatePrivCheck: update R2.T1 set C3=0 UpdatePrivCheck: update R2.T1 set C3=0 InsertPrivCheck: insert into "R2"."T1" values(0,0,0) DeletePrivCheck: delete from "R2"."T1" TriggerPrivCheck: create trigger "T1Trig" after insert on "R2"."T1" for each row mode db2sql values 1 SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C2=0 UpdatePrivCheck: update R1.T1 set C3=0 UpdatePrivCheck: update R1.T1 set C3=0 TriggerPrivCheck: create trigger "T1Trig" after insert on "R1"."T1" for each row mode db2sql values 1 TriggerPrivCheck: create trigger "T1Trig" after insert on "R1"."T1" for each row mode db2sql values 1 Revoke test: multiple table permissions, multiple users SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R1.T1 SelectPrivCheck: select count(*) from "R1"."T1" where (C1 is null) or (C2 is null) or (C3 is null) UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C2=0 UpdatePrivCheck: update R1.T1 set C3=0 UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C2=0 UpdatePrivCheck: update R1.T1 set C3=0 TriggerPrivCheck: create trigger "T1Trig" after insert on "R1"."T1" for each row mode db2sql values 1 TriggerPrivCheck: create trigger "T1Trig" after insert on "R1"."T1" for each row mode db2sql values 1 Revoke test: table privilege implies column privileges UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C2=0 UpdatePrivCheck: update R1.T1 set C3=0 Revoke test: all privileges UpdatePrivCheck: update R1.T1 set C1=0 UpdatePrivCheck: update R1.T1 set C2=0 UpdatePrivCheck: update R1.T1 set C3=0 TriggerPrivCheck: create trigger "T1Trig" after insert on "R1"."T1" for each row mode db2sql values 1 ExecutePrivCheck: values "R1"."F1"() ExecutePrivCheck: values "R1"."F1"() ExecutePrivCheck: call "R1"."F1"() Revoke test: function execute permission ExecutePrivCheck: values "R1"."F1"() ExecutePrivCheck: values "R1"."F1"() ExecutePrivCheck: call "R1"."F1"() Revoke test: function execute permission ExecutePrivCheck: values "R1"."F1"() ExecutePrivCheck: values "R1"."F1"() ExecutePrivCheck: call "R1"."F1"() SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) DeletePrivCheck: delete from "R2"."T1" DeletePrivCheck: delete from "R2"."T1" UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C3=0 UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C3=0 Revoke test: individual permissions leaving public permissions SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) DeletePrivCheck: delete from "R2"."T1" DeletePrivCheck: delete from "R2"."T1" UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C2=0 UpdatePrivCheck: update R2.T1 set C3=0 UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C3=0 Revoke test: public permissions SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R2.T1 SelectPrivCheck: select count(*) from "R2"."T1" where (C1 is null) or (C2 is null) or (C3 is null) DeletePrivCheck: delete from "R2"."T1" DeletePrivCheck: delete from "R2"."T1" UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C2=0 UpdatePrivCheck: update R2.T1 set C3=0 UpdatePrivCheck: update R2.T1 set C1=0 UpdatePrivCheck: update R2.T1 set C3=0 ExecutePrivCheck: values "R2"."F1"() ExecutePrivCheck: values "R2"."F1"() Revoke test: execute leaving public permission ExecutePrivCheck: values "R2"."F1"() ExecutePrivCheck: values "R2"."F1"() Revoke test: execute leaving public permission ExecutePrivCheck: values "R2"."F1"() ExecutePrivCheck: values "R2"."F1"() SelectPrivCheck: select C1,C2 from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C1 is null) or (C2 is null) UpdatePrivCheck: update R2.T3 set C1=0 InsertPrivCheck: insert into "R2"."T3" values(0,0,0) DeletePrivCheck: delete from "R2"."T3" SelectPrivCheck: select * from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C1 is null) or (C2 is null) or (C3 is null) SelectPrivCheck: select * from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C1 is null) or (C2 is null) or (C3 is null) ExecutePrivCheck: call "R1"."P1"() Revoke test: table privileges (uncommitted) Revoke test: table privileges (uncommitted) Revoke test: table privileges (uncommitted) Revoke test: execute privilege (uncommitted) SelectPrivCheck: select C2 from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C2 is null) UpdatePrivCheck: update R2.T3 set C1=0 DeletePrivCheck: delete from "R2"."T3" SelectPrivCheck: select * from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C1 is null) or (C2 is null) or (C3 is null) ExecutePrivCheck: call "R1"."P1"() Revoke test: table privileges (uncommitted) Revoke test: table privileges (uncommitted) Revoke test: table privileges (uncommitted) Revoke test: execute privilege (uncommitted) SelectPrivCheck: select C2 from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C2 is null) UpdatePrivCheck: update R2.T3 set C1=0 DeletePrivCheck: delete from "R2"."T3" SelectPrivCheck: select * from R2.T3 SelectPrivCheck: select count(*) from "R2"."T3" where (C1 is null) or (C2 is null) or (C3 is null) ExecutePrivCheck: call "R1"."P1"() Error cases. Testing error cases ... testErrors: grant xx on s1.t1 to DAN testErrors: grant between on s1.t1 to DAN testErrors: grant select on schema t1 to DAN testErrors: grant select on decimal t1 to DAN testErrors: grant select(nosuchCol) on s1.t1 to DAN testErrors: grant select on nosuch.t1 to DAN testErrors: grant select on s1.nosuch to DAN testErrors: grant execute on function nosuch.f0 to DAN testErrors: grant execute on function s1.nosuch to DAN testErrors: grant execute on function s1.p1 to DAN testErrors: grant execute on procedure nosuch.f0 to DAN testErrors: grant execute on procedure s1.nosuch to DAN testErrors: grant execute on procedure s1.f2 to DAN testErrors: grant execute on table s1.t1 to DAN testErrors: grant select on function s1.f1 to DAN testErrors: grant select on procedure s1.p1 to DAN testErrors: grant execute on function s1.f1 to DAN restrict testErrors: revoke execute on function s1.f1 from DAN testErrors: revoke select on s1.t1 from DAN restrict testErrors: grant delete(c1) on s1.t1 to DAN testErrors: grant trigger(c1) on s1.t1 to DAN PASSED.