db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1398952 - in /db/derby/code/trunk/java/engine/org/apache/derby: catalog/types/AggregateAliasInfo.java impl/sql/compile/CreateAliasNode.java
Date Tue, 16 Oct 2012 19:42:54 GMT
Author: rhillegas
Date: Tue Oct 16 19:42:54 2012
New Revision: 1398952

URL: http://svn.apache.org/viewvc?rev=1398952&view=rev
Log:
DERBY-672: Set the collation of the input and return types of user-defined aggregates.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/types/AggregateAliasInfo.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/types/AggregateAliasInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/types/AggregateAliasInfo.java?rev=1398952&r1=1398951&r2=1398952&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/types/AggregateAliasInfo.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/types/AggregateAliasInfo.java
Tue Oct 16 19:42:54 2012
@@ -27,6 +27,7 @@ import java.io.ObjectOutput;
 
 import org.apache.derby.iapi.services.io.Formatable;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
+import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.catalog.AliasInfo;
 import org.apache.derby.catalog.TypeDescriptor;
 
@@ -94,6 +95,21 @@ public class AggregateAliasInfo implemen
 
     ///////////////////////////////////////////////////////////////////////////////////
     //
+    // BIND TIME LOGIC
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Set the collation type for string input and return types.
+     */
+    public void setCollationTypeForAllStringTypes( int collationType )
+    {
+        _forType = DataTypeDescriptor.getCatalogType( _forType, collationType );
+        _returnType = DataTypeDescriptor.getCatalogType( _returnType, collationType );
+    }
+    
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
     // Formatable BEHAVIOR
     //
     ///////////////////////////////////////////////////////////////////////////////////

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java?rev=1398952&r1=1398951&r2=1398952&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
Tue Oct 16 19:42:54 2012
@@ -480,6 +480,11 @@ public class CreateAliasNode extends DDL
         {
             if ( NON_RESERVED_AGGREGATES[ i ].equals( unqualifiedName ) )  { throw illegalAggregate();
}
         }
+
+        // now bind the input and return types
+        AggregateAliasInfo  aai = (AggregateAliasInfo) aliasInfo;
+
+        aai.setCollationTypeForAllStringTypes( getSchemaDescriptor().getCollationType() );
     }
 
     /** Construct an exception flagging an illegal aggregate name */



Mime
View raw message