db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1187204 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/compile/CompilerContext.java impl/sql/compile/CompilerContextImpl.java impl/sql/compile/FromBaseTable.java
Date Fri, 21 Oct 2011 08:14:34 GMT
Author: kahatlen
Date: Fri Oct 21 08:14:34 2011
New Revision: 1187204

URL: http://svn.apache.org/viewvc?rev=1187204&view=rev
Log:
DERBY-5406: Intermittent failures in CompressTableTest and TruncateTableTest

Make sure the statement receives an invalidation request if the
conglomerate disappears before FromBaseTable has created the dependency
on the table descriptor.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java?rev=1187204&r1=1187203&r2=1187204&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
Fri Oct 21 08:14:34 2011
@@ -287,6 +287,13 @@ public interface CompilerContext extends
 
 	void setCurrentDependent(Dependent d);
 
+    /**
+     * Get the current dependent from this {@code CompilerContext}.
+     *
+     * @return the dependent currently being compiled
+     */
+    Dependent getCurrentDependent();
+
 	/**
 	 * Get the current auxiliary provider list from this CompilerContext.
 	 *

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java?rev=1187204&r1=1187203&r2=1187204&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java
Fri Oct 21 08:14:34 2011
@@ -274,6 +274,10 @@ public class CompilerContextImpl extends
 		currentDependent = d;
 	}
 
+    public Dependent getCurrentDependent() {
+        return currentDependent;
+    }
+
 	/**
 	 * Get the current auxiliary provider list from this CompilerContext.
 	 *

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java?rev=1187204&r1=1187203&r2=1187204&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java Fri
Oct 21 08:14:34 2011
@@ -53,6 +53,8 @@ import org.apache.derby.iapi.sql.compile
 import org.apache.derby.iapi.sql.compile.RowOrdering;
 import org.apache.derby.iapi.sql.compile.Visitor;
 
+import org.apache.derby.iapi.sql.depend.DependencyManager;
+
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;
@@ -2347,8 +2349,20 @@ public class FromBaseTable extends FromT
 					);
 
             // Bail out if the descriptor couldn't be found. The conglomerate
-            // probably doesn't exist anymore.
+            // probably doesn't exist anymore because of concurrent DDL or
+            // compress operations, and the compilation will have to be tried
+            // again.
             if (baseConglomerateDescriptor == null) {
+                // The statement is typically invalidated by the operation
+                // that dropped the conglomerate. However, if the invalidation
+                // happened before we called createDependency(), we'll miss it
+                // and we won't retry the compilation with fresh dictionary
+                // information (DERBY-5406). So let's invalidate the statement
+                // ourselves here.
+                compilerContext.getCurrentDependent().makeInvalid(
+                        DependencyManager.COMPILE_FAILED,
+                        getLanguageConnectionContext());
+
                 throw StandardException.newException(
                         SQLState.STORE_CONGLOMERATE_DOES_NOT_EXIST,
                         new Long(tableDescriptor.getHeapConglomerateId()));



Mime
View raw message