Merge pull request #70410 from ClickHouse/backport/24.8/69787

Backport #69787 to 24.8: Fix 'Bad get' in maxMap state serialization
This commit is contained in:
robot-clickhouse-ci-1 2024-10-05 12:30:02 +02:00 committed by GitHub
commit fa3d99b00a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -298,12 +298,13 @@ public:
Field value = values[col_idx]; Field value = values[col_idx];
/// Compatibility with previous versions. /// Compatibility with previous versions.
if (value.getType() == Field::Types::Decimal32) WhichDataType value_type(values_types[col_idx]);
if (value_type.isDecimal32())
{ {
auto source = value.safeGet<DecimalField<Decimal32>>(); auto source = value.safeGet<DecimalField<Decimal32>>();
value = DecimalField<Decimal128>(source.getValue(), source.getScale()); value = DecimalField<Decimal128>(source.getValue(), source.getScale());
} }
else if (value.getType() == Field::Types::Decimal64) else if (value_type.isDecimal64())
{ {
auto source = value.safeGet<DecimalField<Decimal64>>(); auto source = value.safeGet<DecimalField<Decimal64>>();
value = DecimalField<Decimal128>(source.getValue(), source.getScale()); value = DecimalField<Decimal128>(source.getValue(), source.getScale());

View File

@ -0,0 +1 @@
{"x":"\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}

View File

@ -0,0 +1 @@
select maxMapState([0], [toDateTime64(0, 0)]) as x format JSONEachRow;