mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 02:30:51 +00:00
Merge pull request #9804 from azat/optimize_skip_unused_shards_type_mismatch
Fix SIGSEGV with optimize_skip_unused_shards when type cannot be converted
This commit is contained in:
commit
3550f401ec
@ -116,8 +116,10 @@ namespace
|
||||
if (name == identifier->name)
|
||||
{
|
||||
ColumnWithTypeAndName column;
|
||||
// FIXME: what to do if field is not convertable?
|
||||
column.column = type->createColumnConst(1, convertFieldToType(literal->value, *type));
|
||||
Field value = convertFieldToType(literal->value, *type);
|
||||
if (!literal->value.isNull() && value.isNull())
|
||||
return {};
|
||||
column.column = type->createColumnConst(1, value);
|
||||
column.name = name;
|
||||
column.type = type;
|
||||
return {{std::move(column)}};
|
||||
|
@ -0,0 +1,14 @@
|
||||
set optimize_skip_unused_shards=1;
|
||||
|
||||
drop table if exists data_02000;
|
||||
drop table if exists dist_02000;
|
||||
|
||||
create table data_02000 (key Int) Engine=Null();
|
||||
create table dist_02000 as data_02000 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_02000, key);
|
||||
|
||||
select * from data_02000 where key = 0xdeadbeafdeadbeaf;
|
||||
select * from dist_02000 where key = 0xdeadbeafdeadbeaf settings force_optimize_skip_unused_shards=2; -- { serverError 507; }
|
||||
select * from dist_02000 where key = 0xdeadbeafdeadbeaf;
|
||||
|
||||
drop table data_02000;
|
||||
drop table dist_02000;
|
Loading…
Reference in New Issue
Block a user