Fix stupid bug in parser

This commit is contained in:
alesapin 2020-04-03 15:26:57 +03:00
parent e83b6d0c2e
commit 3b498c603b
2 changed files with 4 additions and 1 deletions

View File

@ -125,7 +125,7 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
} }
else if (s_rename_column.ignore(pos, expected)) else if (s_rename_column.ignore(pos, expected))
{ {
if (s_if_not_exists.ignore(pos, expected)) if (s_if_exists.ignore(pos, expected))
command->if_not_exists = true; command->if_not_exists = true;
if (!parser_name.parse(pos, command->column, expected)) if (!parser_name.parse(pos, command->column, expected))

View File

@ -32,4 +32,7 @@ SELECT renamed_value2, renamed_value3 FROM table_for_rename WHERE key = 7;
SELECT * FROM table_for_rename WHERE key = 7 FORMAT TSVWithNames; SELECT * FROM table_for_rename WHERE key = 7 FORMAT TSVWithNames;
ALTER TABLE table_for_rename RENAME COLUMN value100 to renamed_value100; --{serverError 10}
ALTER TABLE table_for_rename RENAME COLUMN IF EXISTS value100 to renamed_value100;
DROP TABLE IF EXISTS table_for_rename; DROP TABLE IF EXISTS table_for_rename;