From 1344ae963dbdabbf12940de7464aa858d0183a98 Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Fri, 22 Nov 2024 21:09:43 +0000 Subject: [PATCH] Backport #72278 to 24.9: Fix race in `ColumnDynamic::dumpStructure()` --- src/Columns/ColumnDynamic.h | 2 ++ ...4_dynamic_column_data_race_with_concurrent_hj.reference | 0 .../03274_dynamic_column_data_race_with_concurrent_hj.sql | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.reference create mode 100644 tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.sql diff --git a/src/Columns/ColumnDynamic.h b/src/Columns/ColumnDynamic.h index 17b0d80e5eb..c7464090114 100644 --- a/src/Columns/ColumnDynamic.h +++ b/src/Columns/ColumnDynamic.h @@ -310,6 +310,8 @@ public: variant_column_ptr = assert_cast(variant_column.get()); } + void forEachSubcolumn(ColumnCallback callback) const override { callback(variant_column); } + void forEachSubcolumnRecursively(RecursiveMutableColumnCallback callback) override { callback(*variant_column); diff --git a/tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.reference b/tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.sql b/tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.sql new file mode 100644 index 00000000000..c6f2e3b98b0 --- /dev/null +++ b/tests/queries/0_stateless/03274_dynamic_column_data_race_with_concurrent_hj.sql @@ -0,0 +1,7 @@ +SET join_algorithm = 'parallel_hash'; +SET allow_experimental_dynamic_type = 1; +DROP TABLE IF EXISTS t0; +CREATE TABLE t0 (c0 Tuple(c1 Int,c2 Dynamic)) ENGINE = Memory(); +SELECT 1 FROM t0 tx JOIN t0 ty ON tx.c0 = ty.c0; +DROP TABLE t0; +