mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
fix tryGetPreparedSet crash when same set expression built from different columns
This commit is contained in:
parent
ddac1b3f11
commit
55c20ce45b
@ -297,8 +297,13 @@ public:
|
||||
assert(indexes_mapping.size() == data_types.size());
|
||||
|
||||
for (size_t i = 0; i < indexes_mapping.size(); ++i)
|
||||
{
|
||||
/// Same set expression can be construct from different column(s) with different types
|
||||
if (indexes_mapping[i].tuple_index >= candidate_set->getDataTypes().size())
|
||||
return false;
|
||||
if (!candidate_set->areTypesEqual(indexes_mapping[i].tuple_index, data_types[i]))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,3 @@
|
||||
CREATE TABLE set_crash (key1 Int32, id1 Int64, c1 Int64) ENGINE = MergeTree PARTITION BY id1 ORDER BY key1;
|
||||
INSERT INTO set_crash VALUES (-1, 1, 0);
|
||||
SELECT 1 in (-1,1) FROM set_crash WHERE (key1, id1) in (-1, 1);
|
Loading…
Reference in New Issue
Block a user