db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1203799 - in /db/derby/code/branches/10.8: ./ java/client/org/apache/derby/client/net/NetCursor.java java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
Date Fri, 18 Nov 2011 19:35:09 GMT
Author: mamta
Date: Fri Nov 18 19:35:08 2011
New Revision: 1203799

URL: http://svn.apache.org/viewvc?rev=1203799&view=rev
Log:
Backporting revision 1203252 from trunk to 10.8 codeline. Commit comments were as follows


DERBY-5379 testDERBY5120NumRowsInSydependsForTrigger - The number of values assigned is not
the same as the number of specified or implied columns. 
DERBY-5484 Upgradetest fails with upgrade from 10.8.2.2 (7 errors, 1 failure) on trunk 

The above 2 jiras are duplicates. The upgrade tests are failing when doing an upgrade from
10.8.2.2 to trunk. 

The tests that are failing were written for DERBY-5120, DERBY-5044. Both these bugs got fixed
in 10.8.2.2 and higher. 

The purpose of these tests is to show that when the tests are done with a release with those
fixes missing, we will see the incorrect behavior but once the database is upgraded to 10.8.2.2
and higher, the tests will start functioning correctly. The problem is that we do not recognize
that if the database is created with 10.8.2.2, then we will not the problem behavior because
10.8.2.2 already has the required fixes in it for DERBY-5120 and DERBY-5044. I have fixed
this by making the upgrade test understand that incorrect behavior would be seen only for
releases under 10.8.2.2 



Modified:
    db/derby/code/branches/10.8/   (props changed)
    db/derby/code/branches/10.8/java/client/org/apache/derby/client/net/NetCursor.java   (props
changed)
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java

Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov 18 19:35:08 2011
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.7:1061570,1061578,1082235
-/db/derby/code/trunk:1063809,1088633,1089795,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1095247,1096741,1096890,1096991,1097247,1097249,1097460,1097469,1097471,1098033,1101059,1101839,1102620,1102826,1103681,1103718,1103742,1104365,1125305,1126358,1126468,1127825,1127883,1128243,1128942,1129136,1129764,1129797,1130077,1130084,1130632,1130895,1131030,1131272,1132546,1132664,1132747,1132860,1132928,1133304,1133317,1133741,1133752,1134139,1136363,1136371,1136397,1136844,1137213,1138201,1138341,1138444,1138787,1138795,1139449,1139451,1140222,1140744,1141924,1142583,1142635,1145057,1146644,1146915,1146962,1147219,1147242,1147335,1148344,1148354,1148429,1148658,1149054,1149090,1149270,1149482,1149662,1151101,1151612,1158108,1160593,1160597,1161208,1162737,1163131,1163616,1164358,1164370,1164495,1165221,1166313,1167017,1167226,1167470,1169692,1170470,1171227,1171665,1171672,1173446,1173647,1174436,1174646,1176633,1176636,1177589,1179374,1179546,1180790,1180858,
 1181756,1183463,1183503,1183671,1186020,1186691,1189201,1189222
+/db/derby/code/trunk:1063809,1088633,1089795,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1095247,1096741,1096890,1096991,1097247,1097249,1097460,1097469,1097471,1098033,1101059,1101839,1102620,1102826,1103681,1103718,1103742,1104365,1125305,1126358,1126468,1127825,1127883,1128243,1128942,1129136,1129764,1129797,1130077,1130084,1130632,1130895,1131030,1131272,1132546,1132664,1132747,1132860,1132928,1133304,1133317,1133741,1133752,1134139,1136363,1136371,1136397,1136844,1137213,1138201,1138341,1138444,1138787,1138795,1139449,1139451,1140222,1140744,1141924,1142583,1142635,1145057,1146644,1146915,1146962,1147219,1147242,1147335,1148344,1148354,1148429,1148658,1149054,1149090,1149270,1149482,1149662,1151101,1151612,1158108,1160593,1160597,1161208,1162737,1163131,1163616,1164358,1164370,1164495,1165221,1166313,1167017,1167226,1167470,1169692,1170470,1171227,1171665,1171672,1173446,1173647,1174436,1174646,1176633,1176636,1177589,1179374,1179546,1180790,1180858,
 1181756,1183463,1183503,1183671,1186020,1186691,1189201,1189222,1203252

Propchange: db/derby/code/branches/10.8/java/client/org/apache/derby/client/net/NetCursor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov 18 19:35:08 2011
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.7/java/client/org/apache/derby/client/net/NetCursor.java:1061570,1061578,1082235
-/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java:1063809,1088633,1089795,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1095247,1096741,1096890,1096991,1097247,1097249,1097460,1097469,1097471,1098033,1101059,1101839,1102620,1102826,1103681,1103718,1103742,1104365,1125305,1126358,1126468,1127825,1127883,1128243,1128942,1129136,1129764,1129797,1130077,1130084,1130632,1130895,1131030,1131272,1132546,1132664,1132747,1132860,1132928,1133304,1133317,1133741,1133752,1134139,1136363,1136371,1136397,1136844,1137213,1138201,1138341,1138444,1138787,1138795,1139449,1139451,1140222,1140744,1141924,1142583,1142635,1145057,1145961,1146644,1146915,1146962,1147219,1147242,1147335,1148344,1148354,1148429,1148658,1149054,1149090,1149270,1149482,1149662,1151101,1151612,1158108,1160593,1160597,1161208,1162737,1163131,1163616,1164358,1164370,1164495,1165221,1167017,1167470,1169692,1171665,1171672,1173647,1174436,1176633,1176636,1177589,1179374,1179546,1
 180790,1180858,1181756,1183463,1183671,1186020,1186691
+/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java:1063809,1088633,1089795,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1095247,1096741,1096890,1096991,1097247,1097249,1097460,1097469,1097471,1098033,1101059,1101839,1102620,1102826,1103681,1103718,1103742,1104365,1125305,1126358,1126468,1127825,1127883,1128243,1128942,1129136,1129764,1129797,1130077,1130084,1130632,1130895,1131030,1131272,1132546,1132664,1132747,1132860,1132928,1133304,1133317,1133741,1133752,1134139,1136363,1136371,1136397,1136844,1137213,1138201,1138341,1138444,1138787,1138795,1139449,1139451,1140222,1140744,1141924,1142583,1142635,1145057,1145961,1146644,1146915,1146962,1147219,1147242,1147335,1148344,1148354,1148429,1148658,1149054,1149090,1149270,1149482,1149662,1151101,1151612,1158108,1160593,1160597,1161208,1162737,1163131,1163616,1164358,1164370,1164495,1165221,1167017,1167470,1169692,1171665,1171672,1173647,1174436,1176633,1176636,1177589,1179374,1179546,1
 180790,1180858,1181756,1183463,1183671,1186020,1186691,1203252

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java?rev=1203799&r1=1203798&r2=1203799&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
Fri Nov 18 19:35:08 2011
@@ -395,13 +395,11 @@ public class BasicSetup extends UpgradeC
         Statement s = createStatement();
         boolean modeDb2SqlOptional = oldAtLeast(10, 3);
 
-        dropTable("ATDC_BKUP2");
         dropTable("ATDC_BKUP1");
         dropTable("ATDC_TAB1");
         s.execute("create table ATDC_TAB1(c11 int, c12 int)");
         s.execute("insert into ATDC_TAB1 values (1,11)");
         s.execute("create table ATDC_BKUP1(c111 int, c112 int)");
-        s.execute("create table ATDC_BKUP2(c211 int, c212 int)");
         //Three rows will be added in sysdepends for following trigger
         s.execute("create trigger ATDC_TAB1_TRG1 after update "+
            		"of C11 on ATDC_TAB1 REFERENCING old_table as old " +
@@ -448,11 +446,18 @@ public class BasicSetup extends UpgradeC
             //Following update will recpmpile the first trigger since it was
             // marked invalid during the creation of the 2nd trigger. But
             // as part of recompiling, we accidentally erase the dependency
-            // between trigger action sps and trigger table
+            // between trigger action sps and trigger table except in 10.8.2.2 
+            // and higher releases where DERBY-5120 has already been fixed.
             s.execute("update ATDC_TAB1 set c11=11");
             s.executeUpdate("alter table ATDC_TAB1 add column c113 int");
-            s.execute("update ATDC_TAB1 set c11=11");
-        	break;
+
+            //DERBY-5120 has been fixed in 10.8.2.2 and higher and hence we 
+            // will not see the buggy behavior on those codelines
+            if (oldLessThan(10,8,2,2)) 
+                s.execute("update ATDC_TAB1 set c11=11");
+            else
+                assertStatementError("42802", s, " update ATDC_TAB1 set c11=2");        
   
+            break;
 
         case PH_SOFT_UPGRADE:
         case PH_HARD_UPGRADE:
@@ -469,13 +474,19 @@ public class BasicSetup extends UpgradeC
         	// marked invalid and hence they will be regenerated during 
         	// the next time they get fired. This regeneration will cause
         	// the dependency between trigger action sps and trigger table
-        	// be dropped.
+        	// be dropped except in 10.8.2.2 and higher releases where
+        	// DERBY-5120 has already been fixed.
             assertStatementError("42802", s, " update ATDC_TAB1 set c11=2");
 
         	preapreFortDERBY5120();
             s.execute("update ATDC_TAB1 set c12=11");
             s.executeUpdate("alter table ATDC_TAB1 add column c113 int");
-            s.execute("update ATDC_TAB1 set c12=11");
+            //DERBY-5120 has been fixed in 10.8.2.2 and higher and hence we 
+            // will not see the buggy behavior on those codelines
+            if (oldLessThan(10,8,2,2)) 
+                s.execute("update ATDC_TAB1 set c12=11");
+            else
+                assertStatementError("42802", s, " update ATDC_TAB1 set c12=11");       
    
         	break;
 
         case PH_POST_HARD_UPGRADE:
@@ -586,18 +597,31 @@ public class BasicSetup extends UpgradeC
         case PH_POST_SOFT_UPGRADE:
         	//For the CREATE and PH_POST_SOFT_UPGRADE upgrade phases, 
         	// ALTER TABLE DROP COLUMN will not detect that trigger 
-        	// TAB1_TRG1 depends on the column being dropped. This is 
-        	// because of DERBY-5120 and DERBY-5044
+        	// TAB1_TRG1 depends on the column being dropped except
+        	// in 10.8.2.2 and higher releases where DERBY-5044 and
+        	// DERBY-5120 have already been fixed.
         	s.executeUpdate("alter table BKUP1_5044_5120 drop column c112");
-            //Since ALTER TABLE DROP COLUMN did not drop dependent trigger,
-            // following UPDATE sql will fail because trigger TAB1_TRG1 will
-        	// get fired. Trigger TAB1_TRG1 will fail because it is expecting 
-            // more column in BKUP1_5044_5120 than are actually available
-            assertStatementError("42802", s, " update TAB1_5044_5120 set c11=999");
-            //Confirm the behavior mentioned by looking at the table data
-        	rs = s.executeQuery("select * from TAB1_5044_5120");
-            JDBC.assertFullResultSet(rs,
-               		new String[][]{{"99","11"}});        		
+            if (oldLessThan(10,8,2,2)) {
+                //Since in releases prior to 10.8.2.2, ALTER TABLE DROP COLUMN 
+                // did not drop dependent trigger, following UPDATE sql will fail 
+                // for those releases because trigger TAB1_TRG1 will get fired. 
+                // Trigger TAB1_TRG1 will fail because it is expecting more column 
+                // in BKUP1_5044_5120 than are actually available
+            	assertStatementError("42802", s, " update TAB1_5044_5120 set c11=999");
+                //Confirm the behavior mentioned by looking at the table data
+            	rs = s.executeQuery("select * from TAB1_5044_5120");
+                JDBC.assertFullResultSet(rs,
+                   		new String[][]{{"99","11"}});        		
+            } else {
+            	//10.8.2.2 and higher will work fine because DERBY-5044 and
+            	// DERBY-5120 have been fixed in those releases.
+                s.execute("update TAB1_5044_5120 set c11=999");
+                //Confirm the behavior mentioned by looking at the table data
+            	rs = s.executeQuery("select * from TAB1_5044_5120");
+                JDBC.assertFullResultSet(rs,
+                   		new String[][]{{"999","11"}});        		
+            }
+        	
             //No row in BKUP1_5044_5120 because update failed
         	rs = s.executeQuery("select * from BKUP1_5044_5120");
             JDBC.assertEmpty(rs);
@@ -727,23 +751,36 @@ public class BasicSetup extends UpgradeC
             s.execute("insert into ATDC_13_TAB1_BACKUP values (1,11)");
             s.execute("insert into ATDC_13_TAB2 values (1,11)");
 
-            //Following does not detect that column c22 is getting used by
-        	// trigger ATDC_13_TAB1_trg2 defined on ATDC_13_TAB1
-            s.executeUpdate("alter table ATDC_13_TAB2 drop column c22 " +
-            		"restrict");
-            //Following will fail because trigger ATDC_13_TAB1_trg2 will be
-            // fired and it will detect that column ATDC_13_TAB2.c22 getting
-            // used in it's trigger action does not exist anymore
-            assertStatementError("42X04", s,
-               		"update ATDC_13_TAB1 set c12=999");
-            //The number of rows in the tables above didn't change because 
-            // UPDATE sql above failed and hence triggers didn't fire.
-        	rs = s.executeQuery("select * from ATDC_13_TAB1_BACKUP");
-            JDBC.assertFullResultSet(rs,
-               		new String[][]{{"1","11"}});        		
-        	rs = s.executeQuery("select * from ATDC_13_TAB2");
-            JDBC.assertFullResultSet(rs,
-               		new String[][]{{"1"}});
+            if (oldLessThan(10,8,2,2)) {
+                //In releases prior to 10.8.2.2, following does not detect 
+            	// that column c22 is getting used by trigger 
+            	// ATDC_13_TAB1_trg2 defined on ATDC_13_TAB1
+                s.executeUpdate("alter table ATDC_13_TAB2 drop column c22 " +
+                		"restrict");
+                //Following will fail because trigger ATDC_13_TAB1_trg2 will be
+                // fired and it will detect that column ATDC_13_TAB2.c22 getting
+                // used in it's trigger action does not exist anymore
+                assertStatementError("42X04", s,
+                   		"update ATDC_13_TAB1 set c12=999");
+                //The number of rows in the tables above didn't change because 
+                // UPDATE sql above failed and hence triggers didn't fire.
+            	rs = s.executeQuery("select * from ATDC_13_TAB1_BACKUP");
+                JDBC.assertFullResultSet(rs,
+                   		new String[][]{{"1","11"}});        		
+            	rs = s.executeQuery("select * from ATDC_13_TAB2");
+                JDBC.assertFullResultSet(rs,
+                   		new String[][]{{"1"}});
+            } else {
+            	//10.8.2.2 and higher will work fine because DERBY-5044 has
+            	// been fixed in those releases.
+                assertStatementError("X0Y25", s,
+                		"alter table ATDC_13_TAB2 drop column c22 restrict");
+            	s.executeUpdate("update ATDC_13_TAB1 set c12=999");
+            	rs = s.executeQuery("select * from ATDC_13_TAB1_BACKUP");
+                JDBC.assertEmpty(rs);
+            	rs = s.executeQuery("select * from ATDC_13_TAB2");
+                JDBC.assertEmpty(rs);
+            }
         	break;
 
         case PH_SOFT_UPGRADE:



Mime
View raw message