db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r441140 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/suites/ testing/org/apache/derbyTesting/functionTests/test...
Date Thu, 07 Sep 2006 16:54:09 GMT
Author: mikem
Date: Thu Sep  7 09:54:09 2006
New Revision: 441140

URL: http://svn.apache.org/viewvc?view=rev&rev=441140
Log:
DERBY-1729, contributed by Yip Ng
committing derby1729-trunk-diff03.txt patch.

The GrantNode and RevokeNode should have derived from DDLStatementNode instead
of MiscellaneousStatementNode. Subclassing DDLStatementNode will generate a
call to GenericResultSetFactory's getDDLResultSet() in the activation class
and invokes the GenericAuthorizer's authorize() method with the proper
parameters to enforce the correct semantics.

public ResultSet getDDLResultSet (Activation activation) throws StandardExceptio
n
{
        getAuthorizer(activation).authorize(activation, Authorizer.SQL_DDL_OP);
            return getMiscResultSet( activation);
}

Also adding an additional sql file for derbylang. The reason I didn't include
this in grantRevokeDDL.sql is because of name collision and this testcase is
one of the many additonal grant/revoke tests that I wrote and I'll like to
append the rest of those testcases to this file(grantRevokeDDL2.sql) when I
submit my patch for DERBY-1736.


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL2.out
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2.sql
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_app.properties
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_sed.properties
  (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GrantNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GrantNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GrantNode.java?view=diff&rev=441140&r1=441139&r2=441140
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GrantNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GrantNode.java Thu Sep
 7 09:54:09 2006
@@ -33,7 +33,7 @@
 /**
  * This class represents a GRANT statement.
  */
-public class GrantNode extends MiscellaneousStatementNode
+public class GrantNode extends DDLStatementNode
 {
 	private PrivilegeNode privileges;
 	private List grantees;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java?view=diff&rev=441140&r1=441139&r2=441140
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java Thu
Sep  7 09:54:09 2006
@@ -33,7 +33,7 @@
 /**
  * This class represents a REVOKE statement.
  */
-public class RevokeNode extends MiscellaneousStatementNode
+public class RevokeNode extends DDLStatementNode
 {
     private PrivilegeNode privileges;
     private List grantees;

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL2.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL2.out?view=auto&rev=441140
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL2.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL2.out
Thu Sep  7 09:54:09 2006
@@ -0,0 +1,261 @@
+ij> connect 'grantRevokeDDL2;create=true' user 'user1' as user1;
+WARNING 01J14: SQL authorization is being used without first enabling authentication.
+ij> connect 'grantRevokeDDL2;create=true' user 'user2' as user2;
+WARNING 01J01: Database 'grantRevokeDDL2' not created, connection made to existing database
instead.
+WARNING 01J14: SQL authorization is being used without first enabling authentication.
+ij(USER2)> connect 'grantRevokeDDL2;create=true' user 'user3' as user3;
+WARNING 01J01: Database 'grantRevokeDDL2' not created, connection made to existing database
instead.
+WARNING 01J14: SQL authorization is being used without first enabling authentication.
+ij(USER3)> -- DERBY-1729
+-- test grant and revoke in Java stored procedure with triggers.
+-- Java stored procedure that contains grant or revoke statement 
+-- requires MODIFIES SQL DATA to execute.
+-- Since only 2 of the 8 Java stored procedures(which contains
+-- grant or revoke statement) are declared with MODIFIES SQL DATA, 
+-- the rest are expected to fail in this test.
+-- setup the environment
+set connection user1;
+ij(USER1)> -- table used in the procedures
+drop table t1;
+ERROR: Failed with SQLSTATE 42Y07
+ij(USER1)> create table t1 (i int primary key, b char(15));
+0 rows inserted/updated/deleted
+ij(USER1)> insert into t1 values (1, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (2, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (3, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (4, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (5, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (6, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (7, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> insert into t1 values (8, 'XYZ');
+1 row inserted/updated/deleted
+ij(USER1)> -- table used in this test
+drop table t2;
+ERROR: Failed with SQLSTATE 42Y55
+ij(USER1)> create table t2 (x integer, y integer);
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure grant_select_proc1() 
+       parameter style java
+       dynamic result sets 0 language java 
+       NO SQL
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure grant_select_proc2() 
+       parameter style java
+       dynamic result sets 0 language java 
+       CONTAINS SQL
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure grant_select_proc3() 
+       parameter style java
+       dynamic result sets 0 language java 
+       READS SQL DATA 
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure grant_select_proc4() 
+       parameter style java
+       dynamic result sets 0 language java 
+       MODIFIES SQL DATA  
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure revoke_select_proc1() 
+       parameter style java
+       dynamic result sets 0 language java 
+       NO SQL  
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure revoke_select_proc2() 
+       parameter style java
+       dynamic result sets 0 language java 
+       CONTAINS SQL  
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure revoke_select_proc3() 
+       parameter style java
+       dynamic result sets 0 language java 
+       READS SQL DATA 
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> create procedure revoke_select_proc4() 
+       parameter style java
+       dynamic result sets 0 language java 
+       MODIFIES SQL DATA 
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';
+0 rows inserted/updated/deleted
+ij(USER1)> -- tests
+create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc1();
+0 rows inserted/updated/deleted
+ij(USER1)> -- should fail
+delete from t1 where i = 1;
+ERROR: Failed with SQLSTATE 38000
+ERROR: Failed with SQLSTATE 38001
+ij(USER1)> -- check delete failed
+select * from t1 where i = 1;
+I          |B              
+---------------------------
+1          |XYZ            
+1 row selected
+ij(USER1)> drop trigger grant_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should fail
+select * from user1.t1 where i = 1;
+ERROR: Failed with SQLSTATE 28508
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc2();
+0 rows inserted/updated/deleted
+ij(USER1)> -- should fail
+delete from t1 where i = 2;
+ERROR: Failed with SQLSTATE 38000
+ERROR: Failed with SQLSTATE 38002
+ij(USER1)> -- check delete failed
+select * from t1 where i = 2;
+I          |B              
+---------------------------
+2          |XYZ            
+1 row selected
+ij(USER1)> drop trigger grant_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should fail
+select * from user1.t1 where i = 1;
+ERROR: Failed with SQLSTATE 28508
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc3();
+0 rows inserted/updated/deleted
+ij(USER1)> -- should fail
+delete from t1 where i = 3;
+ERROR: Failed with SQLSTATE 38000
+ERROR: Failed with SQLSTATE 38002
+ij(USER1)> -- check delete failed
+select * from t1 where i = 3;
+I          |B              
+---------------------------
+3          |XYZ            
+1 row selected
+ij(USER1)> drop trigger grant_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should fail
+select * from user1.t1 where i = 1;
+ERROR: Failed with SQLSTATE 28508
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc4();
+0 rows inserted/updated/deleted
+ij(USER1)> -- ok
+delete from t1 where i = 4;
+1 row inserted/updated/deleted
+ij(USER1)> -- check delete
+select * from t1 where i = 4;
+I          |B              
+---------------------------
+0 rows selected
+ij(USER1)> drop trigger grant_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should be successful
+select * from user1.t1 where i = 1;
+I          |B              
+---------------------------
+1          |XYZ            
+1 row selected
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc1();
+0 rows inserted/updated/deleted
+ij(USER1)> -- should fail
+delete from t1 where i = 5;
+ERROR: Failed with SQLSTATE 38000
+ERROR: Failed with SQLSTATE 38001
+ij(USER1)> -- check delete failed
+select * from t1 where i = 5;
+I          |B              
+---------------------------
+5          |XYZ            
+1 row selected
+ij(USER1)> drop trigger revoke_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should be successful
+select * from user1.t1 where i = 1;
+I          |B              
+---------------------------
+1          |XYZ            
+1 row selected
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc2();
+0 rows inserted/updated/deleted
+ij(USER1)> -- should fail
+delete from t1 where i = 6;
+ERROR: Failed with SQLSTATE 38000
+ERROR: Failed with SQLSTATE 38002
+ij(USER1)> -- check delete failed
+select * from t1 where i = 6;
+I          |B              
+---------------------------
+6          |XYZ            
+1 row selected
+ij(USER1)> drop trigger revoke_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should be successful
+select * from user1.t1 where i = 1;
+I          |B              
+---------------------------
+1          |XYZ            
+1 row selected
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc3();
+0 rows inserted/updated/deleted
+ij(USER1)> -- should fail
+delete from t1 where i = 7;
+ERROR: Failed with SQLSTATE 38000
+ERROR: Failed with SQLSTATE 38002
+ij(USER1)> -- check delete failed
+select * from t1 where i = 7;
+I          |B              
+---------------------------
+7          |XYZ            
+1 row selected
+ij(USER1)> drop trigger revoke_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should be successful
+select * from user1.t1 where i = 1;
+I          |B              
+---------------------------
+1          |XYZ            
+1 row selected
+ij(USER2)> set connection user1;
+ij(USER1)> create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc4();
+0 rows inserted/updated/deleted
+ij(USER1)> -- ok
+delete from t1 where i = 8;
+1 row inserted/updated/deleted
+ij(USER1)> -- check delete 
+select * from t1 where i = 8;
+I          |B              
+---------------------------
+0 rows selected
+ij(USER1)> drop trigger revoke_select_trig;
+0 rows inserted/updated/deleted
+ij(USER1)> set connection user2;
+ij(USER2)> -- should fail
+select * from user1.t1 where i = 1;
+ERROR: Failed with SQLSTATE 28508
+ij(USER2)> set connection user1;
+ij(USER1)> 

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL2.out
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall?view=diff&rev=441140&r1=441139&r2=441140
==============================================================================
--- 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
Thu Sep  7 09:54:09 2006
@@ -64,6 +64,7 @@
 lang/forupdate.sql
 lang/functions.sql
 lang/grantRevokeDDL.sql
+lang/grantRevokeDDL2.sql
 lang/grantRevoke.java
 lang/groupBy.sql
 lang/holdCursorIJ.sql

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2.sql?view=auto&rev=441140
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2.sql
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2.sql
Thu Sep  7 09:54:09 2006
@@ -0,0 +1,177 @@
+connect 'grantRevokeDDL2;create=true' user 'user1' as user1;
+connect 'grantRevokeDDL2;create=true' user 'user2' as user2;
+connect 'grantRevokeDDL2;create=true' user 'user3' as user3;
+
+-- DERBY-1729
+-- test grant and revoke in Java stored procedure with triggers.
+-- Java stored procedure that contains grant or revoke statement 
+-- requires MODIFIES SQL DATA to execute.
+-- Since only 2 of the 8 Java stored procedures(which contains
+-- grant or revoke statement) are declared with MODIFIES SQL DATA, 
+-- the rest are expected to fail in this test.
+ 
+-- setup the environment
+set connection user1;
+
+-- table used in the procedures
+drop table t1;
+create table t1 (i int primary key, b char(15));
+insert into t1 values (1, 'XYZ');
+insert into t1 values (2, 'XYZ');
+insert into t1 values (3, 'XYZ');
+insert into t1 values (4, 'XYZ');
+insert into t1 values (5, 'XYZ');
+insert into t1 values (6, 'XYZ');
+insert into t1 values (7, 'XYZ');
+insert into t1 values (8, 'XYZ');
+
+-- table used in this test
+drop table t2;
+create table t2 (x integer, y integer);
+
+create procedure grant_select_proc1() 
+       parameter style java
+       dynamic result sets 0 language java 
+       NO SQL
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';

+
+create procedure grant_select_proc2() 
+       parameter style java
+       dynamic result sets 0 language java 
+       CONTAINS SQL
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';

+
+create procedure grant_select_proc3() 
+       parameter style java
+       dynamic result sets 0 language java 
+       READS SQL DATA 
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';

+
+create procedure grant_select_proc4() 
+       parameter style java
+       dynamic result sets 0 language java 
+       MODIFIES SQL DATA  
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.grantSelect';

+
+create procedure revoke_select_proc1() 
+       parameter style java
+       dynamic result sets 0 language java 
+       NO SQL  
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';

+
+create procedure revoke_select_proc2() 
+       parameter style java
+       dynamic result sets 0 language java 
+       CONTAINS SQL  
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';

+
+create procedure revoke_select_proc3() 
+       parameter style java
+       dynamic result sets 0 language java 
+       READS SQL DATA 
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';

+
+create procedure revoke_select_proc4() 
+       parameter style java
+       dynamic result sets 0 language java 
+       MODIFIES SQL DATA 
+       external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.revokeSelect';

+
+-- tests
+
+create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc1();
+-- should fail
+delete from t1 where i = 1;
+-- check delete failed
+select * from t1 where i = 1;
+drop trigger grant_select_trig;
+set connection user2;
+-- should fail
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc2();
+-- should fail
+delete from t1 where i = 2;
+-- check delete failed
+select * from t1 where i = 2; 
+drop trigger grant_select_trig;
+set connection user2;
+-- should fail
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc3();
+-- should fail
+delete from t1 where i = 3;
+-- check delete failed
+select * from t1 where i = 3; 
+drop trigger grant_select_trig;
+set connection user2;
+-- should fail
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger grant_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call grant_select_proc4();
+-- ok
+delete from t1 where i = 4;
+-- check delete
+select * from t1 where i = 4;
+drop trigger grant_select_trig;
+set connection user2;
+-- should be successful
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc1();
+-- should fail
+delete from t1 where i = 5;
+-- check delete failed
+select * from t1 where i = 5;
+drop trigger revoke_select_trig;
+set connection user2;
+-- should be successful
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc2();
+-- should fail
+delete from t1 where i = 6;
+-- check delete failed
+select * from t1 where i = 6;
+drop trigger revoke_select_trig;
+set connection user2;
+-- should be successful
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc3();
+-- should fail
+delete from t1 where i = 7;
+-- check delete failed
+select * from t1 where i = 7; 
+drop trigger revoke_select_trig;
+set connection user2;
+-- should be successful
+select * from user1.t1 where i = 1;
+
+set connection user1;
+create trigger revoke_select_trig AFTER delete on t1 
+	for each STATEMENT mode db2sql call revoke_select_proc4();
+-- ok
+delete from t1 where i = 8;
+-- check delete 
+select * from t1 where i = 8; 
+drop trigger revoke_select_trig;
+set connection user2;
+-- should fail
+select * from user1.t1 where i = 1;
+
+set connection user1;

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_app.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_app.properties?view=auto&rev=441140
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_app.properties
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_app.properties
Thu Sep  7 09:54:09 2006
@@ -0,0 +1,7 @@
+ij.protocol=jdbc:derby:
+ij.showNoConnectionsAtStart=true
+
+derby.database.sqlAuthorization=true
+useextdirs=true
+
+

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_sed.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_sed.properties?view=auto&rev=441140
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_sed.properties
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_sed.properties
Thu Sep  7 09:54:09 2006
@@ -0,0 +1,17 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substitut
+en
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+-------------------------------------------------------------------------------
+--
+--Following needs to be added because permissions for a given sql get collected in HashMap
and order in which items get added
+--   in HashMap can not be relied. Because of this, a user may get error message for different
permissions for a given test sql.
+--   More info on requirement for this sed can be found in JIRA entry DERBY-1330 
+--   
+substitute=^ERROR ([^:]*):.*$;ERROR: Failed with SQLSTATE $1
+

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL2_sed.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java?view=diff&rev=441140&r1=441139&r2=441140
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java
Thu Sep  7 09:54:09 2006
@@ -759,5 +759,23 @@
 
 		rs[0] = st1.executeQuery(query.toString());
 	}
+
+	public static void grantSelect() throws SQLException
+	{
+		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		PreparedStatement ps = conn.prepareStatement("grant select on t1 to user2");
+		ps.execute();
+		ps.close();
+		conn.close();
+	}
+
+	public static void revokeSelect() throws SQLException
+	{
+		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		PreparedStatement ps = conn.prepareStatement("revoke select on t1 from user2");
+		ps.execute();
+		ps.close();
+		conn.close();
+	}
 }
 



Mime
View raw message