You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version of Sharding-Jdbc do you using?(您使用的Sharding-Jdbc版本为?)
最新 2.0.3
Expected behavior (您预期的结果是)
SQL: select * from PM_SYSPAR where (? is null OR PARCODE = ?) and (? is null OR PARCODE_SUB = ?)
实现对目标库的sql查询
Actual behavior (实际运行的结果是)
Caused by: io.shardingjdbc.core.parsing.parser.exception.SQLParsingUnsupportedException: Not supported token 'OR'.
at io.shardingjdbc.core.parsing.lexer.LexerEngine.unsupportedIfEqual(LexerEngine.java:178)
at io.shardingjdbc.core.parsing.parser.clause.WhereClauseParser.parseConditions(WhereClauseParser.java:76)
at io.shardingjdbc.core.parsing.parser.clause.WhereClauseParser.parse(WhereClauseParser.java:68)
Steps to reproduce the behavior (可重现问题的操作步骤)
Please provide the reproduce example codes (such as github link),otherwise we will label the issue as Invalid and close it.(为了节省复现问题的时间,请务必提供可重现的代码,否则我们会将issue直接标记为invalid并关闭)
@Select({
"select * from PM_SYSPAR",
"where ",
" (#{parcode,jdbcType=VARCHAR} is null OR PARCODE = #{parcode,jdbcType=VARCHAR})",
" and (#{parcodeSub,jdbcType=VARCHAR} is null OR PARCODE_SUB = #{parcodeSub,jdbcType=VARCHAR})"
})
@Results({
@Result(column="PARCODE", property="parcode", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="PARNAME", property="parname", jdbcType=JdbcType.VARCHAR),
@Result(column="PARVALUE", property="parvalue", jdbcType=JdbcType.CLOB),
@Result(column="PARCLASS", property="parclass", jdbcType=JdbcType.VARCHAR),
@Result(column="PARSCOPE", property="parscope", jdbcType=JdbcType.VARCHAR),
@Result(column="PARCODE_SUB", property="parcodeSub", jdbcType=JdbcType.VARCHAR),
@Result(column="PARCODE_SUB_DESC", property="parcodeSubDesc", jdbcType=JdbcType.VARCHAR)
})
List<PmSyspar> checkPmSysparDuplicate(Map<String, Object> map);
描述
已经看到Issue#501, 说目前已经支持了OR语句查询, 我使用了最新2.0.3代码, 还是报错
Which version of Sharding-Jdbc do you using?(您使用的Sharding-Jdbc版本为?)
最新 2.0.3
Expected behavior (您预期的结果是)
SQL: select * from PM_SYSPAR where (? is null OR PARCODE = ?) and (? is null OR PARCODE_SUB = ?)
实现对目标库的sql查询
Actual behavior (实际运行的结果是)
Steps to reproduce the behavior (可重现问题的操作步骤)
Please provide the reproduce example codes (such as github link),otherwise we will label the issue as Invalid and close it.(为了节省复现问题的时间,请务必提供可重现的代码,否则我们会将issue直接标记为invalid并关闭)
Code should based on https://github.com/shardingjdbc/sharding-jdbc-example
(代码请基于 https://github.com/shardingjdbc/sharding-jdbc-example)
The text was updated successfully, but these errors were encountered: