druid 解析带关键字字段报错,如:select close pre_price from tab_name

tjvv9vkg  于 3个月前  发布在  Druid
关注(0)|答案(2)|浏览(66)
druid在解析如:select  `close`  pre_price  from tab_name报错:

com.alibaba.druid.sql.parser.ParserException: ERROR. pos 141, line 1, column 136, token CLOSE
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:796)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.primary(MySqlExprParser.java:185)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:86)
at com.alibaba.druid.sql.parser.SQLExprParser.parseSelectItem(SQLExprParser.java:3281)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseSelectList(SQLSelectParser.java:646)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlSelectParser.query(MySqlSelectParser.java:168)
at com.alibaba.druid.sql.parser.SQLSelectParser.query(SQLSelectParser.java:207)
at com.alibaba.druid.sql.parser.SQLSelectParser.select(SQLSelectParser.java:59)

异常,无法解析出表名.

相关问题