提交 e9182152 编写于 作者: B Bruce Momjian

Fix copy for no aggregates.

上级 6a45941f
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.20 1997/12/18 12:53:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.21 1997/12/18 19:13:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -1542,11 +1542,16 @@ _copyQuery(Query *from)
Node_Copy(from, newnode, havingQual); /* currently ignored */
newnode->qry_numAgg = from->qry_numAgg;
newnode->qry_aggs =
(Aggreg **) palloc(sizeof(Aggreg *) * from->qry_numAgg);
for (i=0; i < from->qry_numAgg; i++)
newnode->qry_aggs[i] = _copyAggreg(from->qry_aggs[i]);
if (from->qry_numAgg != NULL)
{
newnode->qry_aggs =
(Aggreg **) palloc(sizeof(Aggreg *) * from->qry_numAgg);
for (i=0; i < from->qry_numAgg; i++)
newnode->qry_aggs[i] = _copyAggreg(from->qry_aggs[i]);
}
else
newnode->query_aggs = NULL;
return newnode;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册