db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r381109 [2/4] - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/db/ engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/iapi/sql/compile/ engine/org/apache/derby/iapi/sql/dictionary/ engine/org/apache/derby/iapi/sql/e...
Date Sun, 26 Feb 2006 15:52:22 GMT
Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=381109&r1=381108&r2=381109&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Sun Feb 26 07:52:18 2006
@@ -1366,6 +1366,7 @@
 	String AUTH_NO_EXECUTE_PERMISSION                                  = "2850A";
 	String AUTH_NO_EXECUTE_PERMISSION_FOR_GRANT                        = "2850B";
 	String AUTH_NOT_OWNER                                              = "2850C";
+	String AUTH_NO_ACCESS_NOT_OWNER                                    = "2850D";
 
 	/*
 	** Dependency manager

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GrantRevoke.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GrantRevoke.out?rev=381109&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GrantRevoke.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GrantRevoke.out
Sun Feb 26 07:52:18 2006
@@ -0,0 +1,241 @@
+name = DAN password = MakeItFaster
+name = KREG password = visualWhat?
+name = JEFF password = HomeRun61
+name = AMES password = AnyVolunteer?
+name = JERRY password = SacreBleu
+name = HOWARDR password = IamBetterAtTennis
+name = FRANCOIS password = paceesalute
+name = JAMIE password = MrNamePlates
+name = OWNER password = BigCheese
+name = PUBLIC password = null
+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
+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
+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
+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
+Grant test: execute on procedure
+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
+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"
+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"
+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
+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
+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
+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
+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"
+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"
+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
+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
+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
+Revoke test: function execute permission
+Revoke test: function execute permission
+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
+Revoke test: execute leaving public permission
+Revoke test: execute leaving public permission
+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)
+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)
+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)
+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.

Copied: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
(from r378825, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevoke.out)
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out?p2=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevoke.out&r1=378825&r2=381109&rev=381109&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevoke.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
Sun Feb 26 07:52:18 2006
@@ -1,6 +1,10 @@
-ij> connect 'grantRevoke;create=true' user 'satheesh' as satConnection;
+ij> connect 'grantRevokeDDL;create=true' user 'satheesh' as satConnection;
 ij> -- Test table privileges
-create table satheesh.tsat(i int, j int);
+create table satheesh.tsat(i int not null primary key, j int);
+0 rows inserted/updated/deleted
+ij> create index tsat_ind on satheesh.tsat(j);
+0 rows inserted/updated/deleted
+ij> create table satheesh.table1 (a int, b int, c char(10));
 0 rows inserted/updated/deleted
 ij> grant select on satheesh.tsat to public;
 0 rows inserted/updated/deleted
@@ -13,12 +17,12 @@
 ij> grant update(i) on satheesh.tsat to bar;
 0 rows inserted/updated/deleted
 ij> select * from sys.systableperms;
-GRANTEE                       |GRANTOR                       |TABLEID                   
         |&|&|&|&|&|&
---------------------------------------------------------------------------------------------------------------
-PUBLIC                        |SATHEESH                      |xxxxFILTERED-UUIDxxxx|y|N|N|N|N|N
-foo                           |SATHEESH                      |xxxxFILTERED-UUIDxxxx|N|y|y|y|N|N
+GRANTEE                                                                                 
                                       |GRANTOR                                          
                                                                              |TABLEID   
                         |&|&|&|&|&|&
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+PUBLIC                                                                                  
                                       |SATHEESH                                         
                                                                              |xxxxFILTERED-UUIDxxxx|y|N|N|N|N|N
+FOO                                                                                     
                                       |SATHEESH                                         
                                                                              |xxxxFILTERED-UUIDxxxx|N|y|y|y|N|N
 2 rows selected
-ij> connect 'grantRevoke' user 'bar' as barConnection;
+ij> connect 'grantRevokeDDL' user 'bar' as barConnection;
 ij(BARCONNECTION)> -- Following revokes should fail. Only owner can revoke permissions
 revoke select on satheesh.tsat from public;
 ERROR 2850C: User 'BAR' is not the owner of Table/View 'SATHEESH'.'TSAT'.
@@ -43,10 +47,10 @@
 0 rows inserted/updated/deleted
 ij(SATCONNECTION)> -- Check success by looking at systableperms directly for now
 select * from sys.systableperms;
-GRANTEE                       |GRANTOR                       |TABLEID                   
         |&|&|&|&|&|&
---------------------------------------------------------------------------------------------------------------
-PUBLIC                        |SATHEESH                      |xxxxFILTERED-UUIDxxxx|y|N|N|N|N|N
-foo                           |SATHEESH                      |xxxxFILTERED-UUIDxxxx|N|N|y|N|N|N
+GRANTEE                                                                                 
                                       |GRANTOR                                          
                                                                              |TABLEID   
                         |&|&|&|&|&|&
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+PUBLIC                                                                                  
                                       |SATHEESH                                         
                                                                              |xxxxFILTERED-UUIDxxxx|y|N|N|N|N|N
+FOO                                                                                     
                                       |SATHEESH                                         
                                                                              |xxxxFILTERED-UUIDxxxx|N|N|y|N|N|N
 2 rows selected
 ij(SATCONNECTION)> revoke insert on satheesh.tsat from foo;
 0 rows inserted/updated/deleted
@@ -54,8 +58,8 @@
 0 rows inserted/updated/deleted
 ij(SATCONNECTION)> -- Check success by looking at systableperms directly for now
 select * from sys.systableperms;
-GRANTEE                       |GRANTOR                       |TABLEID                   
         |&|&|&|&|&|&
---------------------------------------------------------------------------------------------------------------
+GRANTEE                                                                                 
                                       |GRANTOR                                          
                                                                              |TABLEID   
                         |&|&|&|&|&|&
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 0 rows selected
 ij(SATCONNECTION)> -- Test routine permissions
 CREATE FUNCTION F_ABS(P1 INT)
@@ -116,4 +120,114 @@
 -----------
 5          
 1 row selected
-ij(SATCONNECTION)> 
+ij(SATCONNECTION)> -- Test for AUTHORIZATION option for create schema
+-- GrantRevoke TODO: Need to enforce who can create which schema.
+-- More negative test cases need to be added once enforcing is done.
+CREATE SCHEMA MYDODO AUTHORIZATION DODO;
+0 rows inserted/updated/deleted
+ij(SATCONNECTION)> CREATE SCHEMA AUTHORIZATION DERBY;
+0 rows inserted/updated/deleted
+ij(SATCONNECTION)> select * from sys.sysschemas where schemaname not like 'SYS%';
+SCHEMAID                            |SCHEMANAME                                         
                                                                            |AUTHORIZATIONID
                                                                                         
                      
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+xxxxFILTERED-UUIDxxxx|NULLID                                                            
                                                             |DBA                        
                                                                                         
          
+xxxxFILTERED-UUIDxxxx|SQLJ                                                              
                                                             |DBA                        
                                                                                         
          
+xxxxFILTERED-UUIDxxxx|APP                                                               
                                                             |APP                        
                                                                                         
          
+xxxxFILTERED-UUIDxxxx|SATHEESH                                                          
                                                             |SATHEESH                   
                                                                                         
          
+xxxxFILTERED-UUIDxxxx|AUTH_TEST                                                         
                                                             |SATHEESH                   
                                                                                         
          
+xxxxFILTERED-UUIDxxxx|MYDODO                                                            
                                                             |DODO                       
                                                                                         
          
+xxxxFILTERED-UUIDxxxx|DERBY                                                             
                                                             |DERBY                      
                                                                                         
          
+7 rows selected
+ij(SATCONNECTION)> -- Now connect as different user and try to do DDLs in schema owned
by satheesh
+connect 'grantRevokeDDL;user=Swiper' as swiperConnection;
+ij(SWIPERCONNECTION)> set schema satheesh;
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> -- All these DDLs should fail.
+create table NotMyTable (i int, j int);
+ERROR 2850D: User 'SWIPER' can not perform the operation in schema 'SATHEESH'.
+ij(SWIPERCONNECTION)> drop table tsat;
+ERROR 2850D: User 'SWIPER' can not perform the operation in schema 'SATHEESH'.
+ij(SWIPERCONNECTION)> drop index tsat_ind;
+ERROR 2850D: User 'SWIPER' can not perform the operation in schema 'SATHEESH'.
+ij(SWIPERCONNECTION)> create view myview as select * from satheesh.tsat;
+ERROR 2850D: User 'SWIPER' can not perform the operation in schema 'SATHEESH'.
+ij(SWIPERCONNECTION)> CREATE FUNCTION FuncNotMySchema(P1 INT)
+RETURNS INT NO SQL RETURNS NULL ON NULL INPUT
+EXTERNAL NAME 'java.lang.Math.abs'
+EXTERNAL SECURITY DEFINER
+LANGUAGE JAVA PARAMETER STYLE JAVA;
+ERROR 2850D: User 'SWIPER' can not perform the operation in schema 'SATHEESH'.
+ij(SWIPERCONNECTION)> alter table tsat add column k int;
+ERROR 2850D: User 'SWIPER' can not perform the operation in schema 'SATHEESH'.
+ij(SWIPERCONNECTION)> -- Now create own schema
+create schema swiper;
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> create table swiper.mytab ( i int, j int);
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> set schema swiper;
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> -- Some simple DML tests. Should all fail.
+select * from satheesh.tsat;
+ERROR 28508: User 'SWIPER' does not have select permission on column 'I' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> insert into satheesh.tsat values (1, 2);
+ERROR 28506: User 'SWIPER' does not have insert permission on table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> update satheesh.tsat set i=j;
+ERROR 28508: User 'SWIPER' does not have update permission on column 'I' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> create table my_tsat (i int not null, c char(10), constraint fk
foreign key(i) references satheesh.tsat);
+ERROR 28508: User 'SWIPER' does not have references permission on column 'I' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> -- Now grant some permissions to swiper
+set connection satConnection;
+ij(SATCONNECTION)> grant select(i), update(j) on tsat to swiper;
+0 rows inserted/updated/deleted
+ij(SATCONNECTION)> grant all privileges on table1 to swiper;
+0 rows inserted/updated/deleted
+ij(SATCONNECTION)> grant references on tsat to swiper;
+0 rows inserted/updated/deleted
+ij(SATCONNECTION)> set connection swiperConnection;
+ij(SWIPERCONNECTION)> -- Now some of these should pass
+select * from satheesh.tsat;
+ERROR 28508: User 'SWIPER' does not have select permission on column 'J' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> select i from satheesh.tsat;
+I          
+-----------
+0 rows selected
+ij(SWIPERCONNECTION)> select i from satheesh.tsat where j=2;
+ERROR 28508: User 'SWIPER' does not have select permission on column 'J' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> select i from satheesh.tsat where 2 > (select count(i) from satheesh.tsat);
+I          
+-----------
+0 rows selected
+ij(SWIPERCONNECTION)> select i from satheesh.tsat where 2 > (select count(j) from satheesh.tsat);
+ERROR 28508: User 'SWIPER' does not have select permission on column 'J' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> select i from satheesh.tsat where 2 > (select count(*) from satheesh.tsat);
+I          
+-----------
+0 rows selected
+ij(SWIPERCONNECTION)> update satheesh.tsat set j=j+1;
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> update satheesh.tsat set j=2 where i=2;
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> update satheesh.tsat set j=2 where j=1;
+ERROR 28508: User 'SWIPER' does not have select permission on column 'J' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> select * from satheesh.table1;
+A          |B          |C         
+----------------------------------
+0 rows selected
+ij(SWIPERCONNECTION)> select c from satheesh.table1 t1, satheesh.tsat t2 where t1.a =
t2.i;
+C         
+----------
+0 rows selected
+ij(SWIPERCONNECTION)> select b from satheesh.table1 t1, satheesh.tsat t2 where t1.a =
t2.j;
+ERROR 28508: User 'SWIPER' does not have select permission on column 'J' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> select * from satheesh.table1, (select i from satheesh.tsat) table2;
+A          |B          |C         |I          
+----------------------------------------------
+0 rows selected
+ij(SWIPERCONNECTION)> select * from satheesh.table1, (select j from satheesh.tsat) table2;
+ERROR 28508: User 'SWIPER' does not have select permission on column 'J' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> -- GrantRevoke TODO: This one should pass, but currently fails.
Not sure how to handle this yet.
+update satheesh.tsat set j=i;
+ERROR 28508: User 'SWIPER' does not have update permission on column 'I' of table 'SATHEESH'.'TSAT'.
+ij(SWIPERCONNECTION)> create table my_tsat (i int not null, c char(10), constraint fk
foreign key(i) references satheesh.tsat);
+0 rows inserted/updated/deleted
+ij(SWIPERCONNECTION)> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall?rev=381109&r1=381108&r2=381109&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
Sun Feb 26 07:52:18 2006
@@ -63,7 +63,7 @@
 lang/forbitdata.java
 lang/forupdate.sql
 lang/functions.sql
-lang/grantRevoke.sql
+lang/grantRevokeDDL.sql
 lang/groupBy.sql
 lang/holdCursorIJ.sql
 lang/holdCursorJavaReflection.java
@@ -144,4 +144,4 @@
 lang/valuesclause.sql
 lang/views.sql
 lang/wisconsin.java
-lang/ShutdownDatabase.java
\ No newline at end of file
+lang/ShutdownDatabase.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant?rev=381109&r1=381108&r2=381109&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
Sun Feb 26 07:52:18 2006
@@ -246,5 +246,8 @@
 xml_general.sql
 xmlBinding_app.properties
 xmlTestFiles/*
-grantRevoke.sql
+grantRevoke.java
 grantRevoke_app.properties
+grantRevoke_derby.properties
+grantRevokeDDL.sql
+grantRevokeDDL_app.properties



Mime
View raw message