You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-653 Revert SUM(1) behaviour
SUM(1) behaviour was changed as part of MCOL-301. But the original behaviour was correct.
This commit is contained in:
@ -3563,10 +3563,6 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
|
|||||||
if (ac->aggOp() == AggregateColumn::COUNT)
|
if (ac->aggOp() == AggregateColumn::COUNT)
|
||||||
ac->aggOp(AggregateColumn::COUNT_ASTERISK);
|
ac->aggOp(AggregateColumn::COUNT_ASTERISK);
|
||||||
|
|
||||||
// MCOL-301: treat SUM(1) as MAX(1) to get constant result
|
|
||||||
if (ac->aggOp() == AggregateColumn::SUM)
|
|
||||||
ac->aggOp(AggregateColumn::MAX);
|
|
||||||
|
|
||||||
ac->constCol(SRCP(buildReturnedColumn(sfitemp, gwi, gwi.fatalParseError)));
|
ac->constCol(SRCP(buildReturnedColumn(sfitemp, gwi, gwi.fatalParseError)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3605,10 +3601,6 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
|
|||||||
ReturnedColumn* rc = buildReturnedColumn(sfitemp, gwi, gwi.fatalParseError);
|
ReturnedColumn* rc = buildReturnedColumn(sfitemp, gwi, gwi.fatalParseError);
|
||||||
if (dynamic_cast<ConstantColumn*>(rc))
|
if (dynamic_cast<ConstantColumn*>(rc))
|
||||||
{
|
{
|
||||||
// MCOL-301: treat SUM(1) as MAX(1) to get constant result
|
|
||||||
if (ac->aggOp() == AggregateColumn::SUM)
|
|
||||||
ac->aggOp(AggregateColumn::MAX);
|
|
||||||
|
|
||||||
//@bug5229. handle constant function on aggregate argument
|
//@bug5229. handle constant function on aggregate argument
|
||||||
ac->constCol(SRCP(rc));
|
ac->constCol(SRCP(rc));
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user