shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

文档中描述不支持or,某些情况下支持

Open wgou opened this issue 8 years ago • 1 comments

example 中 RawJdbcRepository 修改 查询方法SQL: 版本2.0.3 String sql = "select * from t_order where status =0 or status=1 "; 系统报错,不支持OR操作 String sql = "select * from t_order where ((status =0) or( status=1)) ";正常查询出数据,支持OR操作。

日志: [INFO ] 2018-04-19 12:53:01,480 --main-- [Sharding-JDBC-SQL] Logic SQL: select * from t_order where ((status =0) or (status=1))
[INFO ] 2018-04-19 12:53:01,490 --main-- [Sharding-JDBC-SQL] SQLStatement: SelectStatement(super=DQLStatement(super=AbstractSQLStatement(type=DQL, tables=Tables(tables=[Table(name=t_order, alias=Optional.absent())]), conditions=Conditions(orCondition=OrCondition(andConditions=[])), sqlTokens=[TableToken(beginPosition=14, originalLiterals=t_order)], parametersIndex=0)), containStar=true, selectListLastPosition=9, groupByLastPosition=0, items=[StarSelectItem(owner=Optional.absent())], groupByItems=[], orderByItems=[], limit=null, subQueryStatement=null) [INFO ] 2018-04-19 12:53:01,491 --main-- [Sharding-JDBC-SQL] Actual SQL: demo_ds ::: select * from t_order_0 where ((status =0) or (status=1))
[INFO ] 2018-04-19 12:53:01,491 --main-- [Sharding-JDBC-SQL] Actual SQL: demo_ds ::: select * from t_order_1 where ((status =0) or (status=1))

wgou avatar Apr 19 '18 04:04 wgou

cannot support redundancy brackets

terrymanu avatar Apr 19 '18 04:04 terrymanu