Fix style errors

This commit is contained in:
potya 2020-05-27 15:22:12 +03:00
parent 1fbcdbb58a
commit d5840688a1
4 changed files with 16 additions and 16 deletions

View File

@ -36,4 +36,4 @@ void registerDataTypeNumbers(DataTypeFactory & factory)
factory.registerAlias("DOUBLE", "Float64", DataTypeFactory::CaseInsensitive);
}
}
}

View File

@ -298,12 +298,13 @@ ColumnsDescription InterpreterCreateQuery::getColumnsDescription(const ASTExpres
if (col_decl.is_not && col_decl.is_null) {
if (column_type->isNullable())
throw Exception{"Cant use NOT NULL with Nullable", ErrorCodes::ILLEGAL_SYNTAX_FOR_DATA_TYPE};
} else if (col_decl.is_null && !col_decl.is_not) {
}
else if (col_decl.is_null && !col_decl.is_not)
{
if (column_type->isNullable())
throw Exception{"Cant use NULL with Nullable", ErrorCodes::ILLEGAL_SYNTAX_FOR_DATA_TYPE};
else {
else
column_type = makeNullable(column_type);
}
}
if (context.getSettingsRef().data_type_default_nullable && !column_type->isNullable() && !col_decl.is_not && !col_decl.is_null)

View File

@ -83,8 +83,6 @@ void ASTColumnDeclaration::formatImpl(const FormatSettings & settings, FormatSta
is_null->formatImpl(settings, state, frame);
}
if (default_expression)
{
settings.ostr << ' ' << (settings.hilite ? hilite_keyword : "") << default_specifier << (settings.hilite ? hilite_none : "") << ' ';

View File

@ -171,18 +171,17 @@ bool IParserColumnDeclaration<NameParser>::parseImpl(Pos & pos, ASTPtr & node, E
// Pos pos_before_null = pos;
if (s_not.check(pos, expected)) {
if (s_null.check(pos, expected)) {
if (s_not.check(pos, expected))
if (s_null.check(pos, expected))
{
is_not = std::make_shared<ASTIdentifier>("NOT");
is_null = std::make_shared<ASTIdentifier>("NULL");
} else {
}
else
return false;
}
} else {
if (s_null.check(pos, expected)) {
else
if (s_null.check(pos, expected))
is_null = std::make_shared<ASTIdentifier>("NULL");
}
}
if (s_comment.ignore(pos, expected))
{
@ -213,12 +212,14 @@ bool IParserColumnDeclaration<NameParser>::parseImpl(Pos & pos, ASTPtr & node, E
column_declaration->children.push_back(std::move(type));
}
if (is_null) {
if (is_null)
{
column_declaration->is_null = is_null;
column_declaration->children.push_back(std::move(is_null));
}
if (is_not) {
if (is_not)
{
column_declaration->is_not = is_not;
column_declaration->children.push_back(std::move(is_not));
}