db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1616483 - in /db/derby/code/branches/10.11: ./ java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Date Thu, 07 Aug 2014 12:38:54 GMT
Author: rhillegas
Date: Thu Aug  7 12:38:54 2014
New Revision: 1616483

URL: http://svn.apache.org/r1616483
Log:
DERBY-6692: Port 1616299 from trunk to 10.11 branch.

Modified:
    db/derby/code/branches/10.11/   (props changed)
    db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
    db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java

Propchange: db/derby/code/branches/10.11/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1616299

Modified: db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=1616483&r1=1616482&r2=1616483&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
(original)
+++ db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
Thu Aug  7 12:38:54 2014
@@ -885,7 +885,7 @@ class InsertResultSet extends DMLWriteRe
                  throw se;
              }
  
-             if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT))
+             if ( se.getMessageId().equals(SQLState.LOCK_TIMEOUT) || se.isSelfDeadlock()
)
              {
                  // if we couldn't do this with a nested xaction, retry with
                  // parent-- we need to wait this time!

Modified: db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java?rev=1616483&r1=1616482&r2=1616483&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Thu Aug  7 12:38:54 2014
@@ -385,6 +385,36 @@ public class Changes10_11 extends Upgrad
         }
     }
 
+    /** Test that identity columns handle self-deadlock in soft-upgrade mode */
+    public void test_derby6692() throws Exception
+    {
+        Connection  conn = getConnection();
+        
+        switch (getPhase())
+        {
+            case PH_CREATE:
+            case PH_SOFT_UPGRADE:
+            case PH_POST_SOFT_UPGRADE:
+            case PH_HARD_UPGRADE:
+
+                boolean originalAutoCommit = conn.getAutoCommit();
+                try
+                {
+                    conn.setAutoCommit( false );
+
+                    conn.prepareStatement( "create table t_6692(i int generated always as
identity)" ).execute();
+                    conn.prepareStatement( "insert into t_6692 values (default)" ).execute();
+
+                    conn.rollback();
+                }
+                finally
+                {
+                    conn.setAutoCommit( originalAutoCommit );
+                }
+                break;
+        }
+    }
+
     /** Test the Lucene plugin */
     public void testLuceneSupport() throws Exception
     {



Mime
View raw message