mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
Fix possible crash for SELECT from Merge table with optimize_monotonous_functions_in_order_by eanbled.
This commit is contained in:
parent
0414d95878
commit
1c67437aa4
@ -70,6 +70,9 @@ public:
|
|||||||
if (!pos)
|
if (!pos)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (*pos >= tables.size())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (auto data_type_and_name = tables[*pos].columns.tryGetByName(identifier->shortName()))
|
if (auto data_type_and_name = tables[*pos].columns.tryGetByName(identifier->shortName()))
|
||||||
{
|
{
|
||||||
arg_data_type = data_type_and_name->type;
|
arg_data_type = data_type_and_name->type;
|
||||||
|
@ -13,3 +13,7 @@ SET optimize_monotonous_functions_in_order_by = 1;
|
|||||||
EXPLAIN SYNTAX SELECT * FROM t_02147 ORDER BY toStartOfHour(date), v;
|
EXPLAIN SYNTAX SELECT * FROM t_02147 ORDER BY toStartOfHour(date), v;
|
||||||
EXPLAIN SYNTAX SELECT * FROM t_02147_dist ORDER BY toStartOfHour(date), v;
|
EXPLAIN SYNTAX SELECT * FROM t_02147_dist ORDER BY toStartOfHour(date), v;
|
||||||
EXPLAIN SYNTAX SELECT * FROM t_02147_merge ORDER BY toStartOfHour(date), v;
|
EXPLAIN SYNTAX SELECT * FROM t_02147_merge ORDER BY toStartOfHour(date), v;
|
||||||
|
|
||||||
|
drop table t_02147;
|
||||||
|
CREATE TABLE t_02147 (date DateTime, v UInt32) ENGINE = MergeTree ORDER BY date;
|
||||||
|
select *, toString(t.v) as s from t_02147_merge as t order by date, s;
|
||||||
|
Loading…
Reference in New Issue
Block a user