db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r426847 [2/2] - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/sql/dictionary/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/impl/sql/catalog/ engine/org/apache/derby/impl/sql/compile/ engine/org/apache/derby/impl/s...
Date Sat, 29 Jul 2006 23:13:00 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/syscat.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/syscat.out?rev=426847&r1=426846&r2=426847&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/syscat.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/syscat.out
Sat Jul 29 16:12:58 2006
@@ -82,6 +82,7 @@
 SYSCHECKS_INDEX1                                                                        
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSCOLPERMS_INDEX1                                                                      
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSCOLPERMS_INDEX2                                                                      
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
+SYSCOLPERMS_INDEX3                                                                      
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSCOLUMNS_INDEX1                                                                       
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSCOLUMNS_INDEX2                                                                       
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSCONGLOMERATES_INDEX1                                                                 
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
@@ -100,6 +101,7 @@
 SYSREQUIREDPERM_INDEX1                                                                  
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSROUTINEPERMS_INDEX1                                                                  
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSROUTINEPERMS_INDEX2                                                                  
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
+SYSROUTINEPERMS_INDEX3                                                                  
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSSCHEMAS_INDEX1                                                                       
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSSCHEMAS_INDEX2                                                                       
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSSTATEMENTS_INDEX1                                                                    
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
@@ -107,6 +109,7 @@
 SYSSTATISTICS_INDEX1                                                                    
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSTABLEPERMS_INDEX1                                                                    
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSTABLEPERMS_INDEX2                                                                    
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
+SYSTABLEPERMS_INDEX3                                                                    
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSTABLES_INDEX1                                                                        
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSTABLES_INDEX2                                                                        
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
 SYSTRIGGERS_INDEX1                                                                      
                                       |{ derby.storage.initialPages=1, derby.storage.minimumRecordSize=1,
derby.storage.pageReservedSpace=0, derby.storage.pageSize=4096, derby.storage.reusableRecordId=true
}                                                                                        
                                                                                         
                                                                                         
                                                               
@@ -283,6 +286,7 @@
 SYSCOLPERMS                                                                             
                                       |false
 SYSCOLPERMS                                                                             
                                       |true 
 SYSCOLPERMS                                                                             
                                       |true 
+SYSCOLPERMS                                                                             
                                       |true 
 SYSCOLUMNS                                                                              
                                       |false
 SYSCOLUMNS                                                                              
                                       |true 
 SYSCOLUMNS                                                                              
                                       |true 
@@ -311,6 +315,7 @@
 SYSROUTINEPERMS                                                                         
                                       |false
 SYSROUTINEPERMS                                                                         
                                       |true 
 SYSROUTINEPERMS                                                                         
                                       |true 
+SYSROUTINEPERMS                                                                         
                                       |true 
 SYSSCHEMAS                                                                              
                                       |false
 SYSSCHEMAS                                                                              
                                       |true 
 SYSSCHEMAS                                                                              
                                       |true 
@@ -322,6 +327,7 @@
 SYSTABLEPERMS                                                                           
                                       |false
 SYSTABLEPERMS                                                                           
                                       |true 
 SYSTABLEPERMS                                                                           
                                       |true 
+SYSTABLEPERMS                                                                           
                                       |true 
 SYSTABLES                                                                               
                                       |false
 SYSTABLES                                                                               
                                       |true 
 SYSTABLES                                                                               
                                       |true 
@@ -506,6 +512,7 @@
 SYSCOLPERMS                                                                             
                                       |false
 SYSCOLPERMS                                                                             
                                       |true 
 SYSCOLPERMS                                                                             
                                       |true 
+SYSCOLPERMS                                                                             
                                       |true 
 SYSCOLUMNS                                                                              
                                       |false
 SYSCOLUMNS                                                                              
                                       |true 
 SYSCOLUMNS                                                                              
                                       |true 
@@ -534,6 +541,7 @@
 SYSROUTINEPERMS                                                                         
                                       |false
 SYSROUTINEPERMS                                                                         
                                       |true 
 SYSROUTINEPERMS                                                                         
                                       |true 
+SYSROUTINEPERMS                                                                         
                                       |true 
 SYSSCHEMAS                                                                              
                                       |false
 SYSSCHEMAS                                                                              
                                       |true 
 SYSSCHEMAS                                                                              
                                       |true 
@@ -543,6 +551,7 @@
 SYSSTATISTICS                                                                           
                                       |false
 SYSSTATISTICS                                                                           
                                       |true 
 SYSTABLEPERMS                                                                           
                                       |false
+SYSTABLEPERMS                                                                           
                                       |true 
 SYSTABLEPERMS                                                                           
                                       |true 
 SYSTABLEPERMS                                                                           
                                       |true 
 SYSTABLES                                                                               
                                       |false

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql?rev=426847&r1=426846&r2=426847&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
Sat Jul 29 16:12:58 2006
@@ -898,3 +898,94 @@
 -- cleanup
 drop table t11TriggerRevokeTest;
 
+
+--- Test automatic dropping of dependent permission descriptors when objects they refer to
is dropped.
+--- Dropping of a table, for example, should drop all table and column permission descriptors
on it.
+
+create table newTable(i int, j int, k int);
+
+grant select, update(j) on newTable to sammy;
+
+grant references, delete on newTable to user1;
+
+-- Try with a view
+
+create view myView as select * from newTable;
+
+grant select on myView to sammy;
+
+select * from sys.systableperms where grantee='SAMMY' or grantee='USER1';
+
+select * from sys.syscolperms where grantee='SAMMY' or grantee='USER1';
+
+drop view myView;
+
+select * from sys.systableperms where grantee='SAMMY' or grantee='USER1';
+
+drop table newTable;
+
+select * from sys.systableperms where grantee='SAMMY' or grantee='USER1';
+
+select * from sys.syscolperms where grantee='SAMMY' or grantee='USER1';
+
+--- Try droping of a routine with permission descriptors. Should get dropped
+CREATE FUNCTION newFunction(P1 INT)
+        RETURNS INT 
+        RETURNS NULL ON NULL INPUT
+        EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ProcedureTest.selectFromSpecificSchema'
+        LANGUAGE JAVA PARAMETER STYLE JAVA;
+
+grant execute on function newFunction to sammy;
+
+grant execute on function newFunction(INT) to user3;
+
+select * from sys.sysroutineperms where grantee='SAMMY' or grantee='USER3';
+
+drop function newFunction;
+
+select * from sys.sysroutineperms where grantee='SAMMY' or grantee='USER3';
+
+
+-- Try the same tests after a permission descriptor is likely to have been cached
+
+create table newTable(i int, j int, k int);
+
+grant select(i,j), delete on newTable to sammy;
+
+CREATE FUNCTION F_ABS(P1 INT)
+RETURNS INT NO SQL
+RETURNS NULL ON NULL INPUT
+EXTERNAL NAME 'java.lang.Math.abs'
+LANGUAGE JAVA PARAMETER STYLE JAVA;
+
+grant execute on function f_abs to sammy;
+
+select * from sys.sysroutineperms where grantee='SAMMY';
+
+select * from sys.syscolperms where grantee='SAMMY';
+
+select * from sys.systableperms where grantee='SAMMY';
+
+-- Now connect as sammy and access database objects. That should create
+-- PermissionsDescriptors and cache them
+connect 'grantRevokeDDL' user 'sammy' as sammyConnection;
+
+set schema mamta1;
+
+select i,j from newTable;
+
+values f_abs(-5);
+
+set connection mamta1;
+
+drop table newTable;
+
+drop function f_abs;
+
+-- Confirm rows in catalogs are gone
+select * from sys.sysroutineperms where grantee='SAMMY';
+
+select * from sys.syscolperms where grantee='SAMMY';
+
+select * from sys.systableperms where grantee='SAMMY';
+



Mime
View raw message