Skip to content

Commit 7c2bd32

Browse files
Merge pull request #12401 from ClickHouse/fix_segfault_in_storage_merge
Fix another Context-related segfault
2 parents 74afd5d + 20d95a2 commit 7c2bd32

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Processors/Pipe.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ Pipe::Pipe(Pipes && pipes, ProcessorPtr transform)
9090

9191
max_parallel_streams += pipe.max_parallel_streams;
9292
processors.insert(processors.end(), pipe.processors.begin(), pipe.processors.end());
93+
94+
std::move(pipe.table_locks.begin(), pipe.table_locks.end(), std::back_inserter(table_locks));
95+
std::move(pipe.interpreter_context.begin(), pipe.interpreter_context.end(), std::back_inserter(interpreter_context));
96+
std::move(pipe.storage_holders.begin(), pipe.storage_holders.end(), std::back_inserter(storage_holders));
9397
}
9498

9599
output_port = &transform->getOutputs().front();

tests/queries/0_stateless/01193_metadata_loading.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ done
3939
wait
4040

4141
$CLICKHOUSE_CLIENT -q "CREATE TABLE $db.table_merge (i UInt64, d Date, s String, n Nested(i UInt8, f Float32)) ENGINE=Merge('$db', '^table_')"
42-
#FIXME the following query leads to segfault
43-
#$CLICKHOUSE_CLIENT -q "SELECT count() * $count_multiplier, i, d, s, n.i, n.f FROM $db.table_merge GROUP BY i, d, s, n.i, n.f ORDER BY i"
44-
$CLICKHOUSE_CLIENT -q "SELECT 10000, i, d, s, n.i, n.f FROM $db.table_1_1 GROUP BY i, d, s, n.i, n.f ORDER BY i"
42+
$CLICKHOUSE_CLIENT -q "SELECT count() * $count_multiplier, i, d, s, n.i, n.f FROM $db.table_merge GROUP BY i, d, s, n.i, n.f ORDER BY i"
4543

4644
db_engine=`$CLICKHOUSE_CLIENT -q "SELECT engine FROM system.databases WHERE name='$db'"`
4745

@@ -53,7 +51,6 @@ $CLICKHOUSE_CLIENT -q "SELECT '01193_metadata_loading', $elapsed_ms FORMAT Null"
5351

5452
if [[ $elapsed_ms -le $max_time_ms ]]; then echo ok; fi
5553

56-
#$CLICKHOUSE_CLIENT -q "SELECT count() * $count_multiplier, i, d, s, n.i, n.f FROM $db.table_merge GROUP BY i, d, s, n.i, n.f ORDER BY i"
57-
$CLICKHOUSE_CLIENT -q "SELECT 8000, i, d, s, n.i, n.f FROM $db.table_1_1 GROUP BY i, d, s, n.i, n.f ORDER BY i"
54+
$CLICKHOUSE_CLIENT -q "SELECT count() * $count_multiplier, i, d, s, n.i, n.f FROM $db.table_merge GROUP BY i, d, s, n.i, n.f ORDER BY i"
5855

5956
$CLICKHOUSE_CLIENT -q "DROP DATABASE $db"

0 commit comments

Comments
 (0)