提交 fe30ab68 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Move common parts out of conditional blocks in parseAlterTableAddColumn()

上级 920bf118
......@@ -6254,22 +6254,17 @@ public class Parser {
columnsToAdd.add(column);
} while (readIf(","));
read(")");
if (readIf("BEFORE")) {
command.setAddBefore(readColumnIdentifier());
} else if (readIf("AFTER")) {
command.setAddAfter(readColumnIdentifier());
}
} else {
boolean ifNotExists = readIfNotExists();
command.setIfNotExists(ifNotExists);
String columnName = readColumnIdentifier();
Column column = parseColumnForTable(columnName, true);
columnsToAdd.add(column);
if (readIf("BEFORE")) {
command.setAddBefore(readColumnIdentifier());
} else if (readIf("AFTER")) {
command.setAddAfter(readColumnIdentifier());
}
}
if (readIf("BEFORE")) {
command.setAddBefore(readColumnIdentifier());
} else if (readIf("AFTER")) {
command.setAddAfter(readColumnIdentifier());
}
command.setNewColumns(columnsToAdd);
return command;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论