db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1592726 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile: AggregateNode.java CurrentOfNode.java DDLStatementNode.java FromBaseTable.java MergeNode.java NextSequenceNode.java SetConstraintsNode.java TableName.java
Date Tue, 06 May 2014 11:57:12 GMT
Author: kahatlen
Date: Tue May  6 11:57:11 2014
New Revision: 1592726

URL: http://svn.apache.org/r1592726
Log:
DERBY-6370: dblook doesn't schema-qualify identifiers in trigger actions

Remove unnecessary DataDictionary parameter from TableName.bind().

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MergeNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetConstraintsNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableName.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java Tue
May  6 11:57:11 2014
@@ -292,7 +292,7 @@ class AggregateNode extends UnaryOperato
 
         if ( userAggregateName != null )
         {
-            userAggregateName.bind( dd );
+            userAggregateName.bind();
         }
 
         // If this is a user-defined aggregate that hasn't been bound yet,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java Tue
May  6 11:57:11 2014
@@ -295,9 +295,11 @@ public final class CurrentOfNode extends
 
 		columnsTableName = columnReference.getQualifiedTableName();
 
-        if(columnsTableName != null)
-            if(columnsTableName.getSchemaName() == null && correlationName == null)
-                columnsTableName.bind(this.getDataDictionary());
+        if (columnsTableName != null
+                && columnsTableName.getSchemaName() == null
+                && correlationName == null) {
+            columnsTableName.bind();
+        }
 
 		if (SanityManager.DEBUG)
 		{
@@ -318,9 +320,11 @@ public final class CurrentOfNode extends
 			SanityManager.ASSERT(baseTableName!=null,"no name on target table");
 		}
 
-        if(baseTableName != null)
-            if(baseTableName.getSchemaName() == null && correlationName == null)
-                baseTableName.bind(this.getDataDictionary());
+        if (baseTableName != null
+                && baseTableName.getSchemaName() == null
+                && correlationName == null) {
+            baseTableName.bind();
+        }
 
 		/*
 		 * If the column did not specify a name, or the specified name

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java
Tue May  6 11:57:11 2014
@@ -419,21 +419,6 @@ abstract class DDLStatementNode extends 
 	}
 
 	/**
-	  *	Bind the  object Name. This means filling in the schema name if it
-	  *	wasn't specified.
-	  *
-	  *	@param	dataDictionary	Data dictionary to bind against.
-	  *
-	  *	@exception StandardException		Thrown on error
-	  */
-	void	bindName( DataDictionary	dataDictionary )
-		                       throws StandardException
-	{
-        if (tableName != null)
-            tableName.bind( dataDictionary );
-	}
-
-	/**
 	  *	Make a from list for binding query fragments in a CREATE/ALTER TABLE
       *     statement.
       *

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=1592726&r1=1592725&r2=1592726&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 Tue
May  6 11:57:11 2014
@@ -2335,7 +2335,7 @@ class FromBaseTable extends FromTable
 						   FromList fromListParam) 
 					throws StandardException
 	{
-        tableName.bind(dataDictionary);
+        tableName.bind();
 
         TableDescriptor tabDescr = bindTableDescriptor();
 
@@ -2793,7 +2793,7 @@ class FromBaseTable extends FromTable
         if(columnsTableName != null) {
             if(columnsTableName.getSchemaName() == null && correlationName == null)
             {
-                columnsTableName.bind(this.getDataDictionary());
+                columnsTableName.bind();
             }
         }
 		/*
@@ -2802,8 +2802,11 @@ class FromBaseTable extends FromTable
 		*/
         exposedTableName = getExposedTableName();
 
-        if(exposedTableName.getSchemaName() == null && correlationName == null)
-            exposedTableName.bind(this.getDataDictionary());
+        if (exposedTableName.getSchemaName() == null
+                && correlationName == null) {
+            exposedTableName.bind();
+        }
+
 		/*
 		** If the column did not specify a name, or the specified name
 		** matches the table we're looking at, see whether the column
@@ -4058,14 +4061,11 @@ class FromBaseTable extends FromTable
     TableName getTableName()
 			throws StandardException
 	{
-		TableName tn;
-
-		tn = super.getTableName();
+        TableName tn = super.getTableName();
 
-        if(tn != null) {
-            if(tn.getSchemaName() == null &&
-               correlationName == null)
-                   tn.bind(this.getDataDictionary());
+        if (tn != null && tn.getSchemaName() == null
+                && correlationName == null) {
+            tn.bind();
         }
 
 		return (tn != null ? tn : tableName);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MergeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MergeNode.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MergeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MergeNode.java Tue May
 6 11:57:11 2014
@@ -38,7 +38,6 @@ import org.apache.derby.iapi.sql.compile
 import org.apache.derby.iapi.sql.compile.Visitor;
 import org.apache.derby.iapi.sql.conn.Authorizer;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
@@ -360,7 +359,7 @@ public final class MergeNode extends DML
         forbidDerivedColumnLists();
         
         // synonyms not allowed
-        forbidSynonyms( dd );
+        forbidSynonyms();
 
         //
         // Don't add any privileges until we bind the matching clauses.
@@ -428,17 +427,19 @@ public final class MergeNode extends DML
     }
 
     /** Neither the source nor the target table may be a synonym */
-    private void    forbidSynonyms( DataDictionary dd )    throws StandardException
+    private void forbidSynonyms() throws StandardException
     {
-        forbidSynonyms( dd, _targetTable.getTableNameField().cloneMe() );
+        forbidSynonyms(_targetTable.getTableNameField().cloneMe());
         if ( _sourceTable instanceof FromBaseTable )
         {
-            forbidSynonyms( dd, ((FromBaseTable)_sourceTable).getTableNameField().cloneMe()
);
+            forbidSynonyms(
+                ((FromBaseTable) _sourceTable).getTableNameField().cloneMe());
         }
     }
-    private void    forbidSynonyms( DataDictionary dd, TableName tableName ) throws StandardException
+
+    private void forbidSynonyms(TableName tableName) throws StandardException
     {
-        tableName.bind( dd );
+        tableName.bind();
 
         TableName   synonym = resolveTableToSynonym( tableName );
         if ( synonym != null )

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java
Tue May  6 11:57:11 2014
@@ -87,7 +87,7 @@ class NextSequenceNode extends ValueNode
         }
 
         // lookup sequence object in the data dictionary
-        sequenceName.bind(getDataDictionary());
+        sequenceName.bind();
         SchemaDescriptor sd = getSchemaDescriptor(sequenceName.getSchemaName());
         sequenceDescriptor = getDataDictionary().getSequenceDescriptor(sd, sequenceName.getTableName());
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetConstraintsNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetConstraintsNode.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetConstraintsNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetConstraintsNode.java
Tue May  6 11:57:11 2014
@@ -25,7 +25,6 @@ import java.util.List;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.sql.compile.Visitor;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.shared.common.sanity.SanityManager;
 
@@ -121,11 +120,9 @@ class SetConstraintsNode extends Miscell
     @Override
     public void bindStatement() throws StandardException
     {
-        final DataDictionary dd = getDataDictionary();
-
         if (constraints != null) {
             for (TableName c : constraints) {
-                c.bind(dd);
+                c.bind();
             }
         }
     }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableName.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableName.java?rev=1592726&r1=1592725&r2=1592726&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableName.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableName.java Tue May
 6 11:57:11 2014
@@ -22,11 +22,7 @@
 package	org.apache.derby.impl.sql.compile;
 
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.reference.Property;
-import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.context.ContextManager;
-import org.apache.derby.shared.common.sanity.SanityManager;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.util.IdUtil;
 
 /**
@@ -242,12 +238,9 @@ public class TableName extends QueryTree
 	  *	Bind this TableName. This means filling in the schema name if it
 	  *	wasn't specified.
 	  *
-	  *	@param	dataDictionary	Data dictionary to bind against.
-	  *
 	  *	@exception StandardException		Thrown on error
 	  */
-    void    bind( DataDictionary    dataDictionary )
-		                       throws StandardException
+    void bind() throws StandardException
 	{
         schemaName = getSchemaDescriptor(schemaName).getSchemaName();
 	}



Mime
View raw message