druid-SQLStatementParser 解析带注释的create失败

q35jwt9p  于 4个月前  发布在  Druid
关注(0)|答案(1)|浏览(67)

mysql> CREATE DATABASE /!32312 IF NOT EXISTS/ abcc /*!40100 DEFAULT CHARACTER SET utf8 */;
抛了异常如下,
ERROR 4001 (HY000): com.alibaba.druid.sql.parser.ParserException: error pos 40, line 1, column 16, token HINT
at com.alibaba.druid.sql.parser.SQLExprParser.name(SQLExprParser.java:1334)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseCreateDatabase(MySqlStatementParser.java:4079)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseCreate(MySqlStatementParser.java:259)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:159)
at com.a

5lwkijsr

5lwkijsr1#

-- 注释不会有问题
/* */ 注释会报错

相关问题