db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1084757 - in /db/derby/code/branches/10.7/java: engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java testing/org/apache/derbyTesting/functionTests/tests/memory/TriggerTests.java
Date Wed, 23 Mar 2011 21:37:13 GMT
Author: mamta
Date: Wed Mar 23 21:37:13 2011
New Revision: 1084757

URL: http://svn.apache.org/viewvc?rev=1084757&view=rev
Log:
DERBY-5121 Data corruption when executing an UPDATE trigger

Put a comment explaining why DERBY-1482 changes are being backed out.

Also, disabled all the tests pertaining to DERBY-1482 since the changes for that jira are
being disabled.


Modified:
    db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/TriggerTests.java

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1084757&r1=1084756&r2=1084757&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Wed Mar 23 21:37:13 2011
@@ -4652,6 +4652,12 @@ public final class	DataDictionaryImpl
 			boolean createTriggerTime
 			) throws StandardException
 	{
+        // DERBY-1482 has caused a regression which is being worked
+        // under DERBY-5121. Until DERBY-5121 is fixed, we want
+        // Derby to create triggers same as it is done in 10.6 and
+        // earlier. This in other words means that do not try to
+        // optimize how many columns are read from the trigger table,
+        // simply read all the columns from the trigger table.
 		boolean in10_7_orHigherVersion = false;
 		
 		StringBuffer newText = new StringBuffer();

Modified: db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/TriggerTests.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/TriggerTests.java?rev=1084757&r1=1084756&r2=1084757&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/TriggerTests.java
(original)
+++ db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/TriggerTests.java
Wed Mar 23 21:37:13 2011
@@ -41,9 +41,19 @@ import org.apache.derbyTesting.junit.JDB
 public class TriggerTests extends BaseJDBCTestCase {
 
 	final int lobsize = 50000*1024;
-	boolean testWithLargeDataInLOB = true;
-	
-	/**
+	boolean testWithLargeDataInLOB = true;	
+    // DERBY-1482 has caused a regression which is being worked
+    // under DERBY-5121. Until DERBY-5121 is fixed, we want
+    // Derby to create triggers same as it is done in 10.6 and
+    // earlier. This in other words means that do not try to
+    // optimize how many columns are read from the trigger table,
+    // simply read all the columns from the trigger table.
+    // Because of this, we need to disable the tests that were
+    // added as part of DERBY-1482 to check the column read
+    // optimization.
+    boolean isDerby1482Fixed = false;	
+
+    /**
 	 * Insert trigger tests
 	 * ****************
 	 * 1)test1InsertAfterTrigger
@@ -333,6 +343,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1InsertAfterTrigger() throws SQLException{	
+        if (isDerby1482Fixed == false)
+            return;
+
         basicSetup();
         Statement s = createStatement();
 		s.execute("create trigger trigger1 AFTER INSERT on table1 referencing " +
@@ -350,6 +363,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1InsertAfterTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
         // JSR169 cannot run with tests with stored procedures
         // that do database access - for they require a
         // DriverManager connection to jdbc:default:connection;
@@ -394,6 +410,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1DeleteAfterTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -419,6 +438,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1DeleteAfterTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -469,6 +491,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1UpdateAfterTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
         basicSetup();
         Statement s = createStatement();
 		s.execute("create trigger trigger1 after update of status on table1 referencing " +
@@ -486,6 +511,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1UpdateAfterTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
         // JSR169 cannot run with tests with stored procedures
         // that do database access - for they require a
         // DriverManager connection to jdbc:default:connection;
@@ -526,6 +554,8 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1InsertBeforeTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
 		
         basicSetup();
         Statement s = createStatement();
@@ -544,6 +574,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1InsertBeforeTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
         // JSR169 cannot run with tests with stored procedures
         // that do database access - for they require a
         // DriverManager connection to jdbc:default:connection;
@@ -588,6 +621,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1DeleteBeforeTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -613,6 +649,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1DeleteBeforeTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -665,6 +704,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1UpdateBeforeTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
         basicSetup();
         Statement s = createStatement();
 
@@ -683,6 +725,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test1UpdateBeforeTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
         // JSR169 cannot run with tests with stored procedures
         // that do database access - for they require a
         // DriverManager connection to jdbc:default:connection;
@@ -729,6 +774,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2InsertAfterTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -765,6 +813,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2DeleteAfterTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -815,6 +866,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2UpdateAfterTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -850,6 +904,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2InsertAfterTriggerUpdatedLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -887,6 +944,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2UpdateAfterTriggerUpdatedLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -923,6 +983,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2InsertBeforeTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -957,6 +1020,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2DeleteBeforeTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -992,6 +1058,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test2UpdateBeforeTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1036,6 +1105,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test3UpdateAfterTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1060,6 +1132,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test3UpdateAfterTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1104,6 +1179,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test3UpdateBeforeTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1129,6 +1207,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test3UpdateBeforeTriggerStoredProc() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1179,6 +1260,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test4UpdateAfterTriggerAccessLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1214,6 +1298,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */ 
 	public void test4UpdateAfterTriggerUpdatedLOB() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		
@@ -1252,6 +1339,9 @@ public class TriggerTests extends BaseJD
 	 * @throws SQLException
 	 */
 	public void test4UpdateBeforeTrigger() throws SQLException{
+        if (isDerby1482Fixed == false)
+            return;
+
 		if (testWithLargeDataInLOB)
 			return;
 		



Mime
View raw message