alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.97k stars 8.58k forks source link

SQL SERVER 某些SELECT 语句解析出现错误,但是语句执行没有问题 #1901

Open mwylaoma opened 7 years ago

mwylaoma commented 7 years ago

执行一下语句查询出现错误:

SQL:

SELECT A.value FROM A oost LEFT JOIN B oo WITH (NOLOCK) ON oost.order_id = oo.id

错误信息:

syntax error, error in :'OCK) ON oost.order_id = oo',expect ON, actual ON pos 99, line 1, column 97, token ON at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:280) ~[druid-1.1.2.jar:1.1.2] at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:385) ~[druid-1.1.2.jar:1.1.2] at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:78) ~[druid-1.1.2.jar:1.1.2] at com.alibaba.druid.sql.SQLUtils.format(SQLUtils.java:236) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.filter.logging.LogFilter.logExecutableSql(LogFilter.java:569) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.filter.logging.LogFilter.statementExecuteQueryAfter(LogFilter.java:514) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:468) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2827) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2827) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:182) [druid-1.1.2.jar:1.1.2] at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:228) [druid-1.1.2.jar:1.1.2] at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688) [spring-jdbc-4.2.2.RELEASE.jar:4.2.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629) [spring-jdbc-4.2.2.RELEASE.jar:4.2.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680) [spring-jdbc-4.2.2.RELEASE.jar:4.2.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712) [spring-jdbc-4.2.2.RELEASE.jar:4.2.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722) [spring-jdbc-4.2.2.RELEASE.jar:4.2.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:772) [spring-jdbc-4.2.2.RELEASE.jar:4.2.2.RELEASE]

wenshao commented 7 years ago

问题已经修复,等下一个版本吧,也许就在下个周末

mwylaoma commented 7 years ago

谢谢