From afa4c44a5fd06efa567cf39a88d5ff5167f6c175 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Jan 2018 23:38:08 +0800 Subject: [PATCH] fixed #541 --- RELEASE-NOTES.md | 1 + .../core/parsing/parser/clause/WhereClauseParser.java | 1 + sharding-jdbc-core/src/test/resources/sql/dql/select.xml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fa4824c04d23a..a1140d73a3d12 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,6 +9,7 @@ 1. [ISSUE #521](https://github.com/shardingjdbc/sharding-jdbc/issues/521) YAML文件中ShardingProperties设置无效 1. [ISSUE #522](https://github.com/shardingjdbc/sharding-jdbc/issues/522) 读写分离Slave库不需要执行DDL语句 1. [ISSUE #529](https://github.com/shardingjdbc/sharding-jdbc/issues/529) 表名大写无法查询 +1. [ISSUE #541](https://github.com/shardingjdbc/sharding-jdbc/issues/541) 无法解析IS NOT NULL 1. [ISSUE #557](https://github.com/shardingjdbc/sharding-jdbc/issues/557) GroupBy和OrderBy仅别名不一致问题应使用流式归并 1. [ISSUE #559](https://github.com/shardingjdbc/sharding-jdbc/issues/559) 支持解析以负号和小数点开头的数字(如:-.12) 1. [ISSUE #567](https://github.com/shardingjdbc/sharding-jdbc/issues/567) MySQL补列时增加转义符以防止使用关键字作为列名或别名导致错误 diff --git a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/WhereClauseParser.java b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/WhereClauseParser.java index 411faf4b4f6af..3a9433d539b84 100644 --- a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/WhereClauseParser.java +++ b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/WhereClauseParser.java @@ -116,6 +116,7 @@ private void parseComparisonCondition(final ShardingRule shardingRule, final SQL otherConditionOperators.addAll( Arrays.asList(Symbol.LT, Symbol.LT_EQ, Symbol.GT, Symbol.GT_EQ, Symbol.LT_GT, Symbol.BANG_EQ, Symbol.BANG_GT, Symbol.BANG_LT, DefaultKeyword.LIKE, DefaultKeyword.IS)); if (lexerEngine.skipIfEqual(otherConditionOperators.toArray(new Keyword[otherConditionOperators.size()]))) { + lexerEngine.skipIfEqual(DefaultKeyword.NOT); parseOtherCondition(sqlStatement); } if (lexerEngine.skipIfEqual(DefaultKeyword.NOT)) { diff --git a/sharding-jdbc-core/src/test/resources/sql/dql/select.xml b/sharding-jdbc-core/src/test/resources/sql/dql/select.xml index 5a5dc3f09c40b..a1b382745ae30 100644 --- a/sharding-jdbc-core/src/test/resources/sql/dql/select.xml +++ b/sharding-jdbc-core/src/test/resources/sql/dql/select.xml @@ -3,7 +3,7 @@ - +