mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #3337 from VadimPE/CLICKHOUSE-3021
[CLICKHOUSE-3021] fix bug with unsupported value in CREATE TABLE
This commit is contained in:
commit
4e6fd3e3fe
@ -57,6 +57,7 @@ namespace ErrorCodes
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
extern const int DATABASE_ALREADY_EXISTS;
|
||||
extern const int QUERY_IS_PROHIBITED;
|
||||
extern const int THERE_IS_NO_DEFAULT_VALUE;
|
||||
}
|
||||
|
||||
|
||||
@ -224,6 +225,10 @@ static ColumnsAndDefaults parseColumns(const ASTExpressionList & column_list_ast
|
||||
const auto actions = ExpressionAnalyzer{default_expr_list, context, {}, columns}.getActions(true);
|
||||
const auto block = actions->getSampleBlock();
|
||||
|
||||
for (auto action : actions->getActions())
|
||||
if (action.type == ExpressionAction::Type::JOIN || action.type == ExpressionAction::Type::ARRAY_JOIN)
|
||||
throw Exception("Cannot CREATE table. Unsupported default value that requires ARRAY JOIN or JOIN action", ErrorCodes::THERE_IS_NO_DEFAULT_VALUE);
|
||||
|
||||
for (auto & column : defaulted_columns)
|
||||
{
|
||||
const auto name_and_type_ptr = column.first;
|
||||
|
Loading…
Reference in New Issue
Block a user