You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/01/18 02:32:41 UTC

[GitHub] chenshao6311 commented on issue #1763: The correct result cannot be found when the binding table is associated with the query

chenshao6311 commented on issue #1763: The correct result cannot be found when the binding table is associated with the query
URL: https://github.com/apache/incubator-shardingsphere/issues/1763#issuecomment-455406129
 
 
   In the binding table, the main change is the order of dataNodes of this table rule. The dataNodes of the two binding tables are as follows:
   t_order:
   result.setActualDataNodes("demo_ds_${0..1}.t_order_${[0, 1]}");
   
   t_order_item:
   result.setActualDataNodes("demo_ds_0.t_order_item_1,demo_ds_0.t_order_item_0,demo_ds_1.t_order_item_1,demo_ds_1.t_order_item_0");
   
   
   [INFO ] 2019-01-18 10:27:23,760 --main-- [ShardingSphere-SQL] Logic SQL: SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id AND o.order_id = 292966288664297473 
   [INFO ] 2019-01-18 10:27:23,760 --main-- [ShardingSphere-SQL] SQLStatement: SelectStatement(super=DQLStatement(super=io.shardingsphere.core.parsing.parser.sql.dql.select.SelectStatement@4da9f723), containStar=true, selectListLastPosition=11, groupByLastPosition=0, items=[StarSelectItem(owner=Optional.of(i))], groupByItems=[], orderByItems=[], limit=null, subQueryStatement=null, subQueryStatements=[]) 
   [INFO ] 2019-01-18 10:27:23,760 --main-- [ShardingSphere-SQL] Actual SQL: demo_ds_0 ::: SELECT i.* FROM t_order_1 o, t_order_item_0 i WHERE o.order_id = i.order_id AND o.order_id = 292966288664297473 
   [INFO ] 2019-01-18 10:27:23,760 --main-- [ShardingSphere-SQL] Actual SQL: demo_ds_1 ::: SELECT i.* FROM t_order_1 o, t_order_item_0 i WHERE o.order_id = i.order_id AND o.order_id = 292966288664297473 
   
   order data in dataNode[demo_ds_1.t_order_1] and order_item   data in   dataNode[demo_ds_1.t_order_item_1],So the two statements routed are not satisfied, so the results can not be found. 
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services