db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1497537 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/XMLOptTrace.java
Date Thu, 27 Jun 2013 19:56:40 GMT
Author: rhillegas
Date: Thu Jun 27 19:56:40 2013
New Revision: 1497537

URL: http://svn.apache.org/r1497537
Log:
DERBY-6211: Fix NPE in xml-based optimizer tracing; committing derby-6211-08-aa-fixNPE.diff.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/XMLOptTrace.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/XMLOptTrace.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/XMLOptTrace.java?rev=1497537&r1=1497536&r2=1497537&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/XMLOptTrace.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/XMLOptTrace.java Thu
Jun 27 19:56:40 2013
@@ -489,15 +489,15 @@ class   XMLOptTrace implements  OptTrace
     /** Get the name of an optimizable */
     private TableName    getOptimizableName( Optimizable optimizable )
     {
+        ContextManager  cm = ((QueryTreeNode) optimizable).getContextManager();
+        
         try {
             if ( isBaseTable( optimizable ) )
             {
                 ProjectRestrictNode prn = (ProjectRestrictNode) optimizable;
                 TableDescriptor td = 
                     ((FromBaseTable) prn.getChildResult()).getTableDescriptor();
-                return makeTableName( td.getSchemaName(),
-                                      td.getName(),
-                                      prn.getContextManager() );
+                return makeTableName( td.getSchemaName(), td.getName(), cm );
             }
             else if ( isTableFunction( optimizable ) )
             {
@@ -505,9 +505,7 @@ class   XMLOptTrace implements  OptTrace
                 AliasDescriptor ad =
                     ((StaticMethodCallNode) ((FromVTI) prn.getChildResult()).
                         getMethodCall() ).ad;
-                return makeTableName( ad.getSchemaName(), 
-                                      ad.getName(),
-                                      prn.getContextManager() );
+                return makeTableName( ad.getSchemaName(), ad.getName(), cm );
             }
             else if ( isFromTable( optimizable ) )
             {
@@ -525,7 +523,7 @@ class   XMLOptTrace implements  OptTrace
         String  nodeClass = optimizable.getClass().getName();
         String  unqualifiedName = nodeClass.substring( nodeClass.lastIndexOf( "." ) + 1 );
 
-        return makeTableName( null, unqualifiedName, null );
+        return makeTableName( null, unqualifiedName, cm );
     }
 
     /** Return true if the optimizable is a base table */



Mime
View raw message