db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r493063 - in /db/derby/code/branches/10.2/java: engine/org/apache/derby/impl/sql/catalog/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Fri, 05 Jan 2007 16:16:46 GMT
Author: bpendleton
Date: Fri Jan  5 08:16:45 2007
New Revision: 493063

URL: http://svn.apache.org/viewvc?view=rev&rev=493063
Log:
DERBY-1847: SELECT statement asserts with added column in sqlAuth mode

Merged follow-on patch from trunk to 10.2 branch via
svn merge -r 492918:492919 ../trunk/

Modified:
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?view=diff&rev=493063&r1=493062&r2=493063
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Fri Jan  5 08:16:45 2007
@@ -2508,8 +2508,8 @@
 	        columns.grow(currentLength+1);
 	        curRow.setColumn(SYSCOLPERMSRowFactory.COLUMNS_COL_NUM,
 					  dvf.getDataValue((Object) columns));
-			ti.updateRow(keyRow, curRow,
-					SYSCOLPERMSRowFactory.TABLEID_INDEX_NUM,
+			ti.updateRow(uuidKey, curRow,
+					SYSCOLPERMSRowFactory.COLPERMSID_INDEX_NUM,
 					 bArray, 
 					 colsToUpdate,
 					 tc);

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out?view=diff&rev=493063&r1=493062&r2=493063
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
(original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
Fri Jan  5 08:16:45 2007
@@ -3217,4 +3217,32 @@
 IJ ERROR: Unable to establish cursor
 ij(USER2)> autocommit on;
 ij(USER2)> set connection user1;
+ij(USER1)> -- Another test for DERBY-1847: verify that columns field is updated
+-- correctly when adding a column to a table:
+create table d1847_c (a int, b int, c int);
+0 rows inserted/updated/deleted
+ij(USER1)> grant select (a) on d1847_c to first_user;
+0 rows inserted/updated/deleted
+ij(USER1)> grant update (b) on d1847_c to second_user;
+0 rows inserted/updated/deleted
+ij(USER1)> grant select (c) on d1847_c to third_user;
+0 rows inserted/updated/deleted
+ij(USER1)> select c.grantee, c.type, c.columns from sys.syscolperms c, sys.systables t
+    where c.tableid = t.tableid and t.tablename='D1847_C';
+GRANTEE                                                                                 
                                       |&|COLUMNS        
+--------------------------------------------------------------------------------------------------------------------------------------------------
+FIRST_USER                                                                              
                                       |s|{0}            
+SECOND_USER                                                                             
                                       |u|{1}            
+THIRD_USER                                                                              
                                       |s|{2}            
+3 rows selected
+ij(USER1)> alter table d1847_c add column d int;
+0 rows inserted/updated/deleted
+ij(USER1)> select c.grantee, c.type, c.columns from sys.syscolperms c, sys.systables t
+    where c.tableid = t.tableid and t.tablename='D1847_C';
+GRANTEE                                                                                 
                                       |&|COLUMNS        
+--------------------------------------------------------------------------------------------------------------------------------------------------
+FIRST_USER                                                                              
                                       |s|{0}            
+SECOND_USER                                                                             
                                       |u|{1}            
+THIRD_USER                                                                              
                                       |s|{2}            
+3 rows selected
 ij(USER1)> 

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql?view=diff&rev=493063&r1=493062&r2=493063
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
(original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
Fri Jan  5 08:16:45 2007
@@ -2043,3 +2043,16 @@
 close crs1;
 autocommit on;
 set connection user1;
+
+-- Another test for DERBY-1847: verify that columns field is updated
+-- correctly when adding a column to a table:
+create table d1847_c (a int, b int, c int);
+grant select (a) on d1847_c to first_user;
+grant update (b) on d1847_c to second_user;
+grant select (c) on d1847_c to third_user;
+select c.grantee, c.type, c.columns from sys.syscolperms c, sys.systables t
+    where c.tableid = t.tableid and t.tablename='D1847_C';
+alter table d1847_c add column d int;
+select c.grantee, c.type, c.columns from sys.syscolperms c, sys.systables t
+    where c.tableid = t.tableid and t.tablename='D1847_C';
+



Mime
View raw message