mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-05 08:00:51 +00:00
Better
This commit is contained in:
parent
7a9b96a8f9
commit
60118b65d5
@ -765,8 +765,7 @@ void AlterCommands::validateDefaultExpressionForColumn(
|
||||
auto default_with_cast = makeASTFunction("CAST", copy_expression, std::make_shared<ASTLiteral>(column_type->getName()));
|
||||
auto query_with_alias = setAlias(default_with_cast, tmp_column_name);
|
||||
auto syntax_result = SyntaxAnalyzer(context).analyze(query_with_alias, all_columns.getAll());
|
||||
const auto actions = ExpressionAnalyzer(query_with_alias, syntax_result, context).getActions(true);
|
||||
auto sample_block = actions->getSampleBlock();
|
||||
ExpressionAnalyzer(query_with_alias, syntax_result, context).getActions(true);
|
||||
}
|
||||
catch (Exception & ex)
|
||||
{
|
||||
|
@ -131,6 +131,8 @@ private:
|
||||
bool prepared = false;
|
||||
private:
|
||||
|
||||
/// Validate that default expression and type are compatible, i.e. default
|
||||
/// expression result can be casted to column_type
|
||||
void validateDefaultExpressionForColumn(
|
||||
const ASTPtr default_expression,
|
||||
const String & column_name,
|
||||
@ -145,8 +147,8 @@ public:
|
||||
/// More accurate check have to be performed with storage->checkAlterIsPossible.
|
||||
void validate(const StorageInMemoryMetadata & metadata, const Context & context) const;
|
||||
|
||||
/// Prepare alter commands. Set ignore flag to some of them
|
||||
/// and additional commands for dependent columns.
|
||||
/// Prepare alter commands. Set ignore flag to some of them and set some
|
||||
/// parts to commands from storage's metadata (for example, absent default)
|
||||
void prepare(const StorageInMemoryMetadata & metadata, const Context & context);
|
||||
|
||||
/// Apply all alter command in sequential order to storage metadata.
|
||||
|
Loading…
Reference in New Issue
Block a user