fix bug: parse error 'alter table t1 rename to/as t2'

This commit is contained in:
yakolee
2014-03-03 14:33:21 +08:00
parent 7f687a19ff
commit dcbdac399e
2 changed files with 21 additions and 0 deletions
@@ -2296,6 +2296,9 @@ public class MySqlStatementParser extends SQLStatementParser {
}
} else if (identifierEquals("RENAME")) {
lexer.nextToken();
if (lexer.token() == Token.TO || lexer.token() == Token.AS) {
lexer.nextToken();
}
MySqlRenameTableStatement renameStmt = new MySqlRenameTableStatement();
MySqlRenameTableStatement.Item item = new MySqlRenameTableStatement.Item();
item.setName(stmt.getTableSource().getExpr());