Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解析修改表列名SQL失败 #1667

Closed
melin opened this issue Apr 5, 2017 · 2 comments
Closed

解析修改表列名SQL失败 #1667

melin opened this issue Apr 5, 2017 · 2 comments
Labels
Milestone

Comments

@melin
Copy link
Contributor

melin commented Apr 5, 2017

example: alter table sale_detail change column old_col_name rename to new_col_name;

val parser = OdpsStatementParser(sql)
val stmt = parser.parseStatement()

异常信息:

com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'name rename to new_col_name;',expect COMMENT, actual IDENTIFIER rename
	at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:239)
	at com.alibaba.druid.sql.parser.SQLParser.accept(SQLParser.java:247)
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseAlter(SQLStatementParser.java:888)
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:152)
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatement(SQLStatementParser.java:2065)
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatement(SQLStatementParser.java:2055)
@melin melin changed the title 解析修改表列名失败 解析修改表列名SQL失败 Apr 5, 2017
@melin
Copy link
Contributor Author

melin commented Apr 5, 2017

同时修改列名及列注释 解析也失败:
ALTER TABLE table_name CHANGE COLUMN old_col_name new_col_name column_type COMMENT column_comment;

@wenshao wenshao added the Bug label Apr 5, 2017
@wenshao wenshao added this to the 1.0.30 milestone Apr 5, 2017
@wenshao
Copy link
Member

wenshao commented May 14, 2017

已经支持,请使用新版本 https://github.com/alibaba/druid/releases/tag/1.0.30

@wenshao wenshao closed this as completed May 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants