Skip to content

Commit

Permalink
Backport #54601 to 23.8: Fix serialization of ColumnDecimal
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-clickhouse committed Sep 14, 2023
1 parent a184301 commit 3224384
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Columns/ColumnDecimal.cpp
Expand Up @@ -80,7 +80,7 @@ StringRef ColumnDecimal<T>::serializeValueIntoArena(size_t n, Arena & arena, cha
res.data = pos;
}
memcpy(pos, &data[n], sizeof(T));
return StringRef(pos, sizeof(T));
return res;
}

template <is_decimal T>
Expand Down
@@ -0,0 +1 @@
11 1 1 8 8 7367
@@ -0,0 +1,17 @@
CREATE TABLE max_length_alias_14053__fuzz_45
(
`a` Date,
`b` Nullable(Decimal(76, 45)),
`c.d` Array(Nullable(DateTime64(3))),
`dcount` Int8 ALIAS length(c.d)
)
ENGINE = MergeTree
PARTITION BY toMonday(a)
ORDER BY (a, b)
SETTINGS allow_nullable_key = 1, index_granularity = 8192;

INSERT INTO max_length_alias_14053__fuzz_45 VALUES ('2020-10-06',7367,['2020-10-06','2020-10-06','2020-10-06','2020-10-06','2020-10-06']),('2020-10-06',7367,['2020-10-06','2020-10-06','2020-10-06']),('2020-10-06',7367,['2020-10-06','2020-10-06']),('2020-10-07',7367,['2020-10-07','2020-10-07','2020-10-07','2020-10-07','2020-10-07']),('2020-10-08',7367,['2020-10-08','2020-10-08','2020-10-08','2020-10-08']),('2020-10-11',7367,['2020-10-11','2020-10-11','2020-10-11','2020-10-11','2020-10-11','2020-10-11','2020-10-11','2020-10-11']),('2020-10-11',7367,['2020-10-11']),('2020-08-26',7367,['2020-08-26','2020-08-26']),('2020-08-28',7367,['2020-08-28','2020-08-28','2020-08-28']),('2020-08-29',7367,['2020-08-29']),('2020-09-22',7367,['2020-09-22','2020-09-22','2020-09-22','2020-09-22','2020-09-22','2020-09-22','2020-09-22']);

SELECT count(), min(length(c.d)) AS minExpr, min(dcount) AS minAlias, max(length(c.d)) AS maxExpr, max(dcount) AS maxAlias, b FROM max_length_alias_14053__fuzz_45 GROUP BY b;

DROP TABLE max_length_alias_14053__fuzz_45;

0 comments on commit 3224384

Please sign in to comment.