strongduanmu commented on issue #10699: URL: https://github.com/apache/shardingsphere/issues/10699#issuecomment-858518859
When i set `HintManager.getInstance().setDatabaseShardingValue(1);`, the route result is: ``` [main] INFO ShardingSphere-SQL - Logic SQL: SELECT * FROM t_order [main] INFO ShardingSphere-SQL - SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@62b969c4, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@dcc6211), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@dcc6211, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7, distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty, actualColumns=[ColumnProjection(owner=null, name=order_id, alias=Optional.empty), ColumnProjection(owner=null, name=user_id, alias=Optional.empty), ColumnProjection(owner=null, name=status, alias=Optional.empty), ColumnProjection(owner=null, name=content, alias=Optional.empty), ColumnProjection(owner=null, name=content_new, alias=Optional.empty), ColumnProjection(owner=null, name=content_new_2, alias=Optional.empty), ColumnProjection(owner=null, name=order_name, al ias=Optional.empty), ColumnProjection(owner=null, name=item_cd, alias=Optional.empty)])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@47ec7422, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@48535004, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@610df783, containsSubquery=false) [main] INFO ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT * FROM t_order_0 [main] INFO ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT * FROM t_order_1 ``` When i set `HintManager.getInstance().setDatabaseShardingValue(0);`, the route result is: ``` [main] INFO ShardingSphere-SQL - Logic SQL: SELECT * FROM t_order [main] INFO ShardingSphere-SQL - SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@4441d567, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@3e1624c7), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@3e1624c7, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7, distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty, actualColumns=[ColumnProjection(owner=null, name=order_id, alias=Optional.empty), ColumnProjection(owner=null, name=user_id, alias=Optional.empty), ColumnProjection(owner=null, name=status, alias=Optional.empty), ColumnProjection(owner=null, name=content, alias=Optional.empty), ColumnProjection(owner=null, name=content_new, alias=Optional.empty), ColumnProjection(owner=null, name=content_new_2, alias=Optional.empty), ColumnProjection(owner=null, name=order_name, alias=Optional.empty), ColumnProjection(owner=null, name=item_cd, alias=Optional.empty)])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@62b969c4, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@dcc6211, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@47ec7422, containsSubquery=false) [main] INFO ShardingSphere-SQL - Actual SQL: ds_0 ::: SELECT * FROM t_order_0 [main] INFO ShardingSphere-SQL - Actual SQL: ds_0 ::: SELECT * FROM t_order_1 ``` When i don't set `HintManager.getInstance().setDatabaseShardingValue(0);`, the route result is: ``` [main] INFO ShardingSphere-SQL - Logic SQL: SELECT * FROM t_order [main] INFO ShardingSphere-SQL - SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@6e0cff20, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@359b650b), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@359b650b, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7, distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty, actualColumns=[ColumnProjection(owner=null, name=order_id, alias=Optional.empty), ColumnProjection(owner=null, name=user_id, alias=Optional.empty), ColumnProjection(owner=null, name=status, alias=Optional.empty), ColumnProjection(owner=null, name=content, alias=Optional.empty), ColumnProjection(owner=null, name=content_new, alias=Optional.empty), ColumnProjection(owner=null, name=content_new_2, alias=Optional.empty), ColumnProjection(owner=null, name=order_name, alias=Optional.empty), ColumnProjection(owner=null, name=item_cd, alias=Optional.empty)])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@6a9b0a6f, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@10667848, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@191a709b, containsSubquery=false) [main] INFO ShardingSphere-SQL - Actual SQL: ds_0 ::: SELECT * FROM t_order_0 [main] INFO ShardingSphere-SQL - Actual SQL: ds_0 ::: SELECT * FROM t_order_1 [main] INFO ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT * FROM t_order_0 [main] INFO ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT * FROM t_order_1 ``` So I want to know what is your configuration? What is the abnormal phenomenon? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org