You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2008/02/24 19:00:26 UTC

svn commit: r630645 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java

Author: djd
Date: Sun Feb 24 10:00:23 2008
New Revision: 630645

URL: http://svn.apache.org/viewvc?rev=630645&view=rev
Log:
Add some comments to ResultColumn related to investigations for DERBY-3310 explaining some more about how the column can have a different type to the expression it refers to.

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

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java?rev=630645&r1=630644&r2=630645&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java Sun Feb 24 10:00:23 2008
@@ -50,10 +50,17 @@
  * statements, the result column represents an column in a stored table.
  * So, a ResultColumn has to be bound differently depending on the type of
  * statement it appears in.
- * 
+ * <P>
  * The type of the ResultColumn can differ from its underlying expression,
  * for example in certain joins the ResultColumn can be nullable even if
- * its underlying column is not.
+ * its underlying column is not. In an INSERT or UPDATE the ResultColumn
+ * will represent the type of the column in the table, the type of
+ * the underlying expresion will be the type of the source of the
+ * value to be insert or updated. The method columnTypeAndLengthMatch()
+ * can be used to detect when normalization is required between
+ * the expression and the tyoe of ResultColumn. This class does
+ * not implement any type normalization (conversion), this is
+ * typically handled by a NormalizeResultSetNode.
  *
  */
 
@@ -911,7 +918,7 @@
 		mb.upCast(ClassName.DataValueDescriptor);
 	}
 
-	/*
+	/**
 	** Check whether the column length and type of this result column
 	** match the expression under the columns.  This is useful for
 	** INSERT and UPDATE statements.  For SELECT statements this method
@@ -921,7 +928,6 @@
 	** @return	true means the column matches its expressions,
 	**			false means it doesn't match.
 	*/
-
 	boolean columnTypeAndLengthMatch()
 		throws StandardException
 	{
@@ -947,9 +953,6 @@
         
         
         DataTypeDescriptor  expressionType = getExpression().getTypeServices();
-        
-        if (expressionType == null)
-            System.out.println(getExpression().getClass());
         
         if (!getTypeServices().isExactTypeAndLengthMatch(expressionType))
             return false;