You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Fix regression in a query involving an aggregate function on a
non-wide decimal column in the HAVING clause. In buildAggregateColumn(), if an aggregate function (such as avg) is applied on a non-wide decimal column, we were setting the precision of the resulting column as -1. This later down in the execution got converted to 255 as in some cases, precision is stored as uint8_t. The predicate operations on a DECIMAL column has logic that uses the wide Decimal::s128value field if precision > 18. This logic incorrectly used the Decimal::s128value instead of the correct value stored in the narrow Decimal::value field, since precision of the Decimal column was 255. The fix is to set the aggregate column precision to datatypes::INT64MAXPRECISION (18) in buildAggregateColumn() when the aggregate is applied on a non-wide decimal column. This commit also partially fixes -Wstrict-aliasing GCC warnings.
This commit is contained in:
@ -5068,7 +5068,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
|
||||
{
|
||||
ct.scale += datatypes::MAXSCALEINC4AVG;
|
||||
}
|
||||
ct.precision = datatypes::IGNOREPRECISION;
|
||||
ct.precision = datatypes::INT64MAXPRECISION;
|
||||
}
|
||||
ac->resultType(ct);
|
||||
}
|
||||
|
Reference in New Issue
Block a user