mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge branch 'master' of github.com:ClickHouse/ClickHouse
This commit is contained in:
commit
ad2af03f98
@ -18,7 +18,7 @@ static bool sameConstants(const IColumn & a, const IColumn & b)
|
||||
return assert_cast<const ColumnConst &>(a).getField() == assert_cast<const ColumnConst &>(b).getField();
|
||||
}
|
||||
|
||||
ColumnWithTypeAndName getLeastSuperColumn(std::vector<const ColumnWithTypeAndName *> columns)
|
||||
ColumnWithTypeAndName getLeastSuperColumn(const std::vector<const ColumnWithTypeAndName *> & columns)
|
||||
{
|
||||
if (columns.empty())
|
||||
throw Exception("Logical error: no src columns for supercolumn", ErrorCodes::LOGICAL_ERROR);
|
||||
|
@ -7,6 +7,6 @@ namespace DB
|
||||
{
|
||||
|
||||
/// getLeastSupertype + related column changes
|
||||
ColumnWithTypeAndName getLeastSuperColumn(std::vector<const ColumnWithTypeAndName *> columns);
|
||||
ColumnWithTypeAndName getLeastSuperColumn(const std::vector<const ColumnWithTypeAndName *> & columns);
|
||||
|
||||
}
|
||||
|
@ -124,18 +124,18 @@ Block InterpreterSelectWithUnionQuery::getCommonHeaderForUnion(const Blocks & he
|
||||
+ "\nand\n"
|
||||
+ headers[query_num].dumpNames() + "\n",
|
||||
ErrorCodes::UNION_ALL_RESULT_STRUCTURES_MISMATCH);
|
||||
}
|
||||
|
||||
std::vector<const ColumnWithTypeAndName *> columns(num_selects);
|
||||
|
||||
for (size_t column_num = 0; column_num < num_columns; ++column_num)
|
||||
{
|
||||
std::vector<const ColumnWithTypeAndName *> columns;
|
||||
columns.reserve(num_selects);
|
||||
for (size_t i = 0; i < num_selects; ++i)
|
||||
columns.push_back(&headers[i].getByPosition(column_num));
|
||||
columns[i] = &headers[i].getByPosition(column_num);
|
||||
|
||||
ColumnWithTypeAndName & result_elem = common_header.getByPosition(column_num);
|
||||
result_elem = getLeastSuperColumn(columns);
|
||||
}
|
||||
}
|
||||
|
||||
return common_header;
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
select 1 as c1, 2 as c2, 3 as c3 union all (select 1 as c1, 2 as c2, 3 as c3 union all select 1 as c1, 2 as c2) -- { serverError 258 }
|
Loading…
Reference in New Issue
Block a user