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 ka...@apache.org on 2013/03/21 13:54:00 UTC

svn commit: r1459276 [2/2] - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java Thu Mar 21 12:53:57 2013
@@ -68,9 +68,11 @@ public class SelectNode extends ResultSe
 	FromList	fromList;
 	FromTable targetTable;
 
-	/* Aggregate Vectors for select and where clauses */
+    /** Aggregates in the SELECT list. */
     private List selectAggregates;
+    /** Aggregates in the WHERE clause. */
     private List whereAggregates;
+    /** Aggregates in the HAVING clause. */
     private List havingAggregates;
 
 	/**
@@ -141,7 +143,6 @@ public class SelectNode extends ResultSe
 	
 	private int nestingLevel;
 	public void init(Object selectList,
-			  Object aggregateVector,
 			  Object fromList,
 			  Object whereClause,
 			  Object groupByList,
@@ -149,7 +150,7 @@ public class SelectNode extends ResultSe
 			  Object windowDefinitionList)
 			throws StandardException
 	{
-		/* RESOLVE - remove aggregateList from constructor.
+        /* RESOLVE -
 		 * Consider adding selectAggregates and whereAggregates 
 		 */
 		resultColumns = (ResultColumnList) selectList;
@@ -669,10 +670,11 @@ public class SelectNode extends ResultSe
 		/* If query is grouped, bind the group by list. */
 		if (groupByList != null)
 		{
-			ArrayList gbAggregateVector = new ArrayList();
+            // We expect zero aggregates, so initialize the holder array
+            // with zero capacity.
+            ArrayList groupByAggregates = new ArrayList(0);
 
-			groupByList.bindGroupByColumns(this,
-										   gbAggregateVector);
+            groupByList.bindGroupByColumns(this, groupByAggregates);
 
 			/*
 			** There should be no aggregates in the Group By list.
@@ -681,8 +683,8 @@ public class SelectNode extends ResultSe
 			*/
 			if (SanityManager.DEBUG)
 			{
-				SanityManager.ASSERT(gbAggregateVector.isEmpty(),
-						"Unexpected Aggregate vector generated by Group By clause");
+                SanityManager.ASSERT(groupByAggregates.isEmpty(),
+                    "Unexpected aggregate list generated by GROUP BY clause");
 			}
 
 			checkNoWindowFunctions(groupByList, "GROUP BY");

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -1117,7 +1117,6 @@ abstract class SetOperatorNode extends T
 			(ResultSetNode) getNodeFactory().getNode(
 				C_NodeTypes.SELECT_NODE,
 				rcl,      // ResultColumns
-				null,     // AGGREGATE list
 				fromList, // FROM list
 				null,     // WHERE clause
 				null,     // GROUP BY list

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SimpleStringOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SimpleStringOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SimpleStringOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SimpleStringOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -61,22 +61,20 @@ public class SimpleStringOperatorNode ex
 	 *
 	 * @param fromList			The query's FROM list
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-		FromList	fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		TypeId	operandType;
 
-		bindOperand(fromList, subqueryList, 
-				aggregateVector);
+        bindOperand(fromList, subqueryList, aggregates);
 
 		/*
 		** Check the type of the operand - this function is allowed only on

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SpecialFunctionNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SpecialFunctionNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SpecialFunctionNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SpecialFunctionNode.java Thu Mar 21 12:53:57 2013
@@ -106,15 +106,14 @@ public class SpecialFunctionNode extends
 	 *							is not used in this case.
 	 * @param subqueryList		The subquery list being built as we find 
 	 *							SubqueryNodes. Not used in this case.
-	 * @param aggregateVector	The aggregate vector being built as we find 
+     * @param aggregates        The aggregate list being built as we find
 	 *							AggregateNodes. Not used in this case.
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList,
-							List aggregateVector)
+    ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List aggregates)
 					throws StandardException
 	{		DataTypeDescriptor dtd;
 		int nodeType = getNodeType();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java Thu Mar 21 12:53:57 2013
@@ -84,17 +84,15 @@ public final class StaticClassFieldRefer
 	 * as well as figuring out what the return type is for this expression.
 	 *
 	 * @param fromList		The FROM list for the query this
-	 *				expression is in, for binding columns.
-	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     *                      expression is in, for binding columns.
+     * @param subqueryList  The subquery list being built as we find SubqueryNodes
+     * @param aggregates    The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	Nothing
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-
-	public JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		ClassInspector classInspector = getClassFactory().getClassInspector();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java Thu Mar 21 12:53:57 2013
@@ -167,18 +167,16 @@ public class StaticMethodCallNode extend
 	 * as well as figuring out what the return type is for this expression.
 	 *
 	 * @param fromList		The FROM list for the query this
-	 *				expression is in, for binding columns.
-	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     *                      expression is in, for binding columns.
+     * @param subqueryList  The subquery list being built as we find SubqueryNodes
+     * @param aggregates    The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	this or an AggregateNode
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-
-	public JavaValueNode bindExpression(
-		FromList fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    JavaValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		// for a function we can get called recursively
@@ -186,7 +184,7 @@ public class StaticMethodCallNode extend
 			return this;
 
 
-		bindParameters(fromList, subqueryList, aggregateVector);
+        bindParameters(fromList, subqueryList, aggregates);
 
 		
 		/* If javaClassName is null then we assume that the current methodName
@@ -207,7 +205,7 @@ public class StaticMethodCallNode extend
 
             // The field methodName is used by resolveRoutine and
             // is set to the name of the routine (procedureName.getTableName()).
-			resolveRoutine( fromList, subqueryList, aggregateVector, sd );
+            resolveRoutine( fromList, subqueryList, aggregates, sd );
 
             if ( (ad != null) && (ad.getAliasType() == AliasInfo.ALIAS_TYPE_AGGREGATE_AS_CHAR) )
             {
@@ -242,7 +240,7 @@ public class StaticMethodCallNode extend
                 // an in-memory table, set up in DataDictioanryImpl.
                 sd = getSchemaDescriptor("SYSFUN", true);
 
-                resolveRoutine(fromList, subqueryList, aggregateVector, sd);
+                resolveRoutine(fromList, subqueryList, aggregates, sd);
             }
 
             if (ad == null) {
@@ -267,7 +265,7 @@ public class StaticMethodCallNode extend
 
                     forCallStatement = true; // temporarily: resolve
                                              // as procedure
-                    resolveRoutine(fromList, subqueryList, aggregateVector, sd);
+                    resolveRoutine(fromList, subqueryList, aggregates, sd);
                     forCallStatement = false; // restore it
 
                     if (ad != null) {
@@ -279,7 +277,7 @@ public class StaticMethodCallNode extend
                     // Maybe a function is being CALLed ?
                     forCallStatement = false; // temporarily: resolve
                                               // as function
-                    resolveRoutine(fromList, subqueryList, aggregateVector, sd);
+                    resolveRoutine(fromList, subqueryList, aggregates, sd);
                     forCallStatement = true; // restore it
 
                     if (ad != null) {
@@ -400,7 +398,7 @@ public class StaticMethodCallNode extend
 										returnValueCastNode, 
 										getContextManager());
 					returnValueToJava.setCollationType(returnType.getCollationType());
-					return returnValueToJava.bindExpression(fromList, subqueryList, aggregateVector);
+                    return returnValueToJava.bindExpression(fromList, subqueryList, aggregates);
 				}
 
 			}
@@ -494,14 +492,9 @@ public class StaticMethodCallNode extend
 	 * with a given type and name is allowed, thus if changes are made to
 	 * support overloaded routines, careful code inspection and testing will
 	 * be required.
-	 * @param fromList
-	 * @param subqueryList
-	 * @param aggregateVector
-	 * @param sd
-	 * @throws StandardException
 	 */
     private void resolveRoutine(FromList fromList, SubqueryList subqueryList,
-                                List aggregateVector, SchemaDescriptor sd)
+                                List aggregates, SchemaDescriptor sd)
             throws StandardException {
 		if (sd.getUUID() != null) {
 
@@ -610,7 +603,7 @@ public class StaticMethodCallNode extend
                     {
                         coerceMethodParameter
                             (
-                             fromList, subqueryList, aggregateVector,
+                             fromList, subqueryList, aggregates,
                              rai,
                              methodParms.length,
                              paramdtd, parameterTypeId, parameterMode,
@@ -622,7 +615,7 @@ public class StaticMethodCallNode extend
                 {
                     coerceMethodParameter
                         (
-                         fromList, subqueryList, aggregateVector,
+                         fromList, subqueryList, aggregates,
                          rai,
                          methodParms.length,
                          paramdtd, parameterTypeId, parameterMode,
@@ -679,7 +672,7 @@ public class StaticMethodCallNode extend
         (
          FromList fromList,
          SubqueryList subqueryList,
-         List aggregateVector,
+         List aggregates,
          RoutineAliasInfo rai,
          int    parameterCount, // number of declared routine args
          DataTypeDescriptor paramdtd,   // declared type of routine arg
@@ -824,7 +817,8 @@ public class StaticMethodCallNode extend
                  getContextManager()
                  );
 
-            methodParms[p] = methodParms[p].bindExpression(fromList, subqueryList, aggregateVector);
+            methodParms[p] = methodParms[p].bindExpression(
+                    fromList, subqueryList, aggregates);
         }
 
         // only force the type for a ? so that the correct type shows up

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java Thu Mar 21 12:53:57 2013
@@ -443,14 +443,13 @@ public class SubqueryNode extends ValueN
 	 *							NOTE: fromList will be null if the subquery appears
 	 *							in a VALUES clause.
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList,
-					List aggregateVector)
+    ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List aggregates)
 				throws StandardException
 	{
 		ResultColumnList	resultColumns;
@@ -545,7 +544,7 @@ public class SubqueryNode extends ValueN
 		if (leftOperand != null)
 		{
 			leftOperand = leftOperand.bindExpression(fromList, subqueryList,
-									   aggregateVector);
+                                       aggregates);
 		}
 
 		if (orderByList != null) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java Thu Mar 21 12:53:57 2013
@@ -610,7 +610,7 @@ public class TableElementList extends Qu
 
 		cc = getCompilerContext();
 
-		ArrayList aggregateVector = new ArrayList();
+        ArrayList aggregates = new ArrayList();
 
 		for (int index = 0; index < size; index++)
 		{
@@ -652,11 +652,11 @@ public class TableElementList extends Qu
 
 				// Tell the compiler context to only allow deterministic nodes
 				cc.setReliability( CompilerContext.CHECK_CONSTRAINT );
-				checkTree = checkTree.bindExpression(fromList, (SubqueryList) null,
-										 aggregateVector);
+                checkTree = checkTree.bindExpression(
+                        fromList, (SubqueryList) null, aggregates);
 
 				// no aggregates, please
-				if (!aggregateVector.isEmpty())
+                if (!aggregates.isEmpty())
 				{
 					throw StandardException.newException(SQLState.LANG_INVALID_CHECK_CONSTRAINT, cdn.getConstraintText());
 				}
@@ -745,7 +745,7 @@ public class TableElementList extends Qu
         
 		cc = getCompilerContext();
 
-		ArrayList aggregateVector = new ArrayList();
+        ArrayList aggregates = new ArrayList();
 
 		for (int index = 0; index < size; index++)
 		{
@@ -788,8 +788,8 @@ public class TableElementList extends Qu
 				// Tell the compiler context to forbid subqueries and
 				// non-deterministic functions.
 				cc.setReliability( CompilerContext.GENERATION_CLAUSE_RESTRICTION );
-				generationTree = generationClauseNode.bindExpression(fromList, (SubqueryList) null,
-										 aggregateVector);
+                generationTree = generationClauseNode.bindExpression(
+                        fromList, (SubqueryList) null, aggregates);
 
                 //
                 // If the user did not declare a type for this column, then the column type defaults
@@ -831,7 +831,7 @@ public class TableElementList extends Qu
                 }
 
 				// no aggregates, please
-				if (!aggregateVector.isEmpty())
+                if (!aggregates.isEmpty())
 				{
 					throw StandardException.newException( SQLState.LANG_AGGREGATE_IN_GENERATION_CLAUSE, cdn.getName());
 				}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -186,27 +186,26 @@ public class TernaryOperatorNode extends
 	 * @param fromList		The FROM list for the query this
 	 *				expression is in, for binding columns.
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		receiver = receiver.bindExpression(fromList, subqueryList, 
-			aggregateVector);
+            aggregates);
 
 		leftOperand = leftOperand.bindExpression(fromList, subqueryList,
-			    aggregateVector);
+                aggregates);
 
 		if (rightOperand != null)
 		{
 			rightOperand = rightOperand.bindExpression(fromList, subqueryList, 
-				aggregateVector);
+                aggregates);
 		}
 		if (operatorType == TRIM)
 			trimBind();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TestConstraintNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TestConstraintNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TestConstraintNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TestConstraintNode.java Thu Mar 21 12:53:57 2013
@@ -75,19 +75,18 @@ public class TestConstraintNode extends 
 	 *
 	 * @param fromList			The query's FROM list
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-		FromList fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
-		bindOperand(fromList, subqueryList, aggregateVector);
+        bindOperand(fromList, subqueryList, aggregates);
 
 		/*
 		** If the operand is not boolean, cast it.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TimestampOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TimestampOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TimestampOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TimestampOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -67,21 +67,21 @@ public class TimestampOperatorNode exten
 	 * @param fromList		The FROM list for the query this
 	 *				expression is in, for binding columns.
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-        FromList fromList, SubqueryList subqueryList, List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		leftOperand = leftOperand.bindExpression(fromList, subqueryList, 
-			aggregateVector);
+            aggregates);
 		rightOperand = rightOperand.bindExpression(fromList, subqueryList, 
-			aggregateVector);
+            aggregates);
 
 		//Set the type if there is a parameter involved here 
 		if (leftOperand.requiresTypeFromContext()) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryArithmeticOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryArithmeticOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryArithmeticOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryArithmeticOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -140,16 +140,15 @@ public class UnaryArithmeticOperatorNode
 	 *
 	 * @param fromList			The query's FROM list
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-		FromList	fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		//Return with no binding, if the type of unary minus/plus parameter is not set yet.
@@ -157,8 +156,7 @@ public class UnaryArithmeticOperatorNode
 				&& operand.getTypeServices() == null)
 				return this;
 
-		bindOperand(fromList, subqueryList,
-				aggregateVector);
+        bindOperand(fromList, subqueryList, aggregates);
 
 		if (operatorType == SQRT || operatorType == ABSOLUTE)
 		{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryComparisonOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryComparisonOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryComparisonOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryComparisonOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -57,20 +57,18 @@ public abstract class UnaryComparisonOpe
 	 *
 	 * @param fromList			The query's FROM list
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-		FromList fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
-		bindOperand(fromList, subqueryList, 
-							 aggregateVector);
+        bindOperand(fromList, subqueryList, aggregates);
 
 		/* Set type info for this node */
 		bindComparisonOperator();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryDateTimestampOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryDateTimestampOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryDateTimestampOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryDateTimestampOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -90,21 +90,20 @@ public class UnaryDateTimestampOperatorN
 	 * @param fromList		The FROM list for the query this
 	 *				expression is in, for binding columns.
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ValueNode bindExpression (
-					FromList fromList, SubqueryList subqueryList,
-					List aggregateVector)
+    ValueNode bindExpression (
+                    FromList fromList, SubqueryList subqueryList, List aggregates)
 				throws StandardException
 	{
         boolean isIdentity = false; // Is this function the identity operator?
         boolean operandIsNumber = false;
         
-        bindOperand( fromList, subqueryList, aggregateVector);
+        bindOperand( fromList, subqueryList, aggregates);
         DataTypeDescriptor operandType = operand.getTypeServices();
         switch( operandType.getJDBCTypeId())
         {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryLogicalOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryLogicalOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryLogicalOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryLogicalOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -56,20 +56,18 @@ public abstract class UnaryLogicalOperat
 	 *
 	 * @param fromList			The query's FROM list
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-		FromList fromList, SubqueryList subqueryList,
-		List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
-		bindOperand(fromList, subqueryList,
-							 aggregateVector);
+        bindOperand(fromList, subqueryList, aggregates);
 
 		/*
 		** Logical operators work only on booleans.  If the operand 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryOperatorNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnaryOperatorNode.java Thu Mar 21 12:53:57 2013
@@ -288,19 +288,18 @@ public class UnaryOperatorNode extends O
 	 * @param fromList		The FROM list for the query this
 	 *				expression is in, for binding columns.
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-					FromList fromList, SubqueryList subqueryList,
-					List aggregateVector)
+    ValueNode bindExpression(
+            FromList fromList, SubqueryList subqueryList, List aggregates)
 				throws StandardException
 	{
-		bindOperand(fromList, subqueryList, aggregateVector);
+        bindOperand(fromList, subqueryList, aggregates);
         if (operatorType == XMLPARSE_OP)
             bindXMLParse();
         else if (operatorType == XMLSERIALIZE_OP)
@@ -315,11 +314,10 @@ public class UnaryOperatorNode extends O
      * method to bind the operand.
 	 */
 	protected void bindOperand(
-            FromList fromList, SubqueryList subqueryList, List aggregateVector)
+            FromList fromList, SubqueryList subqueryList, List aggregates)
 				throws StandardException
 	{
-		operand = operand.bindExpression(fromList, subqueryList,
-								aggregateVector);
+        operand = operand.bindExpression(fromList, subqueryList, aggregates);
 
 		if (operand.requiresTypeFromContext()) {
 			bindParameter();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UntypedNullConstantNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UntypedNullConstantNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UntypedNullConstantNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UntypedNullConstantNode.java Thu Mar 21 12:53:57 2013
@@ -97,8 +97,8 @@ public final class UntypedNullConstantNo
 	 * This does nothing-- the node is actually bound when
 	 * bindUntypedNullsToResultColumns is called.
 	 */
-    public ValueNode bindExpression(
-        FromList fromList, SubqueryList	subqueryList, List aggregateVector)
+    ValueNode bindExpression(
+        FromList fromList, SubqueryList subqueryList, List aggregates)
 	{
 		return this;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNode.java Thu Mar 21 12:53:57 2013
@@ -365,11 +365,11 @@ public abstract class ValueNode extends 
 	}
 
 	
-	public ValueNode bindExpression(
-            FromList fromList, SubqueryList subqueryList, List aggregateVector)
+    ValueNode bindExpression(
+            FromList fromList, SubqueryList subqueryList, List aggregates)
 		throws StandardException
 	{
-		return bindExpression(fromList, subqueryList, aggregateVector,false);
+        return bindExpression(fromList, subqueryList, aggregates, false);
 	}
 	
 
@@ -380,16 +380,15 @@ public abstract class ValueNode extends 
 	 * @param fromList			The FROM list to use for binding
 	 * @param subqueryList		The SubqueryList we are building as we hit
 	 *							SubqueryNodes.
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @return	The new top of the expression tree.
 	 *
 	 * @exception StandardException	Thrown on error
 	 */
 
-	public ValueNode bindExpression(
-			FromList fromList, SubqueryList subqueryList,
-			List aggregateVector, boolean forQueryRewrite)
+    ValueNode bindExpression(
+            FromList fromList, SubqueryList subqueryList, List aggregates, boolean forQueryRewrite)
 				throws StandardException
 	{
 		/* There are a bizillion classes which extend ValueNode.  Here is info

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java Thu Mar 21 12:53:57 2013
@@ -70,13 +70,11 @@ public class ValueNodeList extends Query
 	 * @param fromList		The FROM list for the query this
 	 *				expression is in, for binding columns.
 	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
-	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
+     * @param aggregates        The aggregate list being built as we find AggregateNodes
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void	bindExpression(FromList fromList, 
-							   SubqueryList subqueryList,
-							   List aggregateVector)
+    void bindExpression(FromList fromList, SubqueryList subqueryList, List aggregates)
 			throws StandardException
 	{
 		int size = size();
@@ -84,8 +82,7 @@ public class ValueNodeList extends Query
 		for (int index = 0; index < size; index++)
 		{
 			ValueNode vn = (ValueNode) elementAt(index);
-			vn = vn.bindExpression(fromList, subqueryList,
-								   aggregateVector);
+            vn = vn.bindExpression(fromList, subqueryList, aggregates);
 
 			setElementAt(vn, index);
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowFunctionNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowFunctionNode.java?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowFunctionNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowFunctionNode.java Thu Mar 21 12:53:57 2013
@@ -104,10 +104,8 @@ public abstract class WindowFunctionNode
      * ValueNode override.
      * @see ValueNode#bindExpression
      */
-    public ValueNode bindExpression(
-            FromList fromList,
-            SubqueryList subqueryList,
-            List aggregateVector)
+    ValueNode bindExpression(
+            FromList fromList, SubqueryList subqueryList, List aggregates)
         throws StandardException
     {
         if (window instanceof WindowReferenceNode) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=1459276&r1=1459275&r2=1459276&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Thu Mar 21 12:53:57 2013
@@ -737,7 +737,6 @@ public class SQLParser
 		SelectNode resultSet = (SelectNode) nodeFactory.getNode(
 										C_NodeTypes.SELECT_NODE,
 										null,
-										null, 	/* AGGREGATE list */
 										fromList, /* FROM list */
 					  					whereClause, /* WHERE clause */
 										null, /* GROUP BY list */
@@ -778,7 +777,6 @@ public class SQLParser
 		SelectNode resultSet = (SelectNode) nodeFactory.getNode(
 										C_NodeTypes.SELECT_NODE,
 										setClause,
-										null, 	/* AGGREGATE list */
 										fromList, /* FROM list */
 					  					whereClause, /* WHERE clause */
 										null, /* GROUP BY list */
@@ -9057,7 +9055,6 @@ tableExpression(ResultColumnList selectL
 		selectNode = (SelectNode) nodeFactory.getNode(
 							C_NodeTypes.SELECT_NODE,
 							selectList,
-							null, 		/* AGGREGATE list */
 							fromList,
 							whereClause,
 							groupByList,