xiaoxiong581 opened a new issue #4665: order by not support string column when 
query more than one database
URL: https://github.com/apache/incubator-shardingsphere/issues/4665
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response **more than 7 days** and we cannot reproduce it on current 
information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   4.0.0
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-Proxy(docker registry to deploy)
   ### Expected behavior
   more than one database query support order by use string column
   ### Actual behavior
   not support, only support when route one database, cross database support i 
test is int、datetime etc, if use string column to order by, query sql is always 
executing, cann't get result or error
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   #### create table sql
   ```sql
   CREATE TABLE t_cluster(
       clusterId VARCHAR(64) NOT NULL   COMMENT '数据库集群ID' ,
       clusterName VARCHAR(128) NOT NULL   COMMENT '数据库集群名称' ,
       projectId VARCHAR(64) NOT NULL   COMMENT '项目ID' ,
       createTime DATETIME NOT NULL   COMMENT '创建时间' ,
       updateTime DATETIME NOT NULL   COMMENT '更新时间' ,
       PRIMARY KEY (clusterId)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT = '数据库集群信息表';
   ALTER TABLE t_cluster ADD UNIQUE index_cluster_unique_name(clusterName);
   ```
   #### server.yaml
   ```yaml
   authentication:
     users:
       root:
         password: xxxxx
       migu:
         password: xxxxx
         authorizedSchemas: databasemanager
   props:
     sql.show: true
   ```
   #### config-databasemanager.yaml
   ```yaml
   schemaName: databasemanager
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://192.168.137.102:3306/databasemanager?serverTimezone=UTC&useSSL=false
       username: root
       password: xxxxx
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
     ds_1:
       url: 
jdbc:mysql://192.168.137.102:3307/databasemanager?serverTimezone=UTC&useSSL=false
       username: root
       password: xxxx
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   shardingRule:
     tables:
       t_cluster:
         actualDataNodes: ds_${0..1}.t_cluster
         tableStrategy:
           none:
         databaseStrategy:
           inline:
             shardingColumn: clusterId
             algorithmExpression: ds_${clusterId.hashCode().abs() % 2}
       t_cluster_instance:
         actualDataNodes: ds_${0..1}.t_cluster_instance
         tableStrategy:
           none:
         databaseStrategy:
           inline:
             shardingColumn: clusterId
             algorithmExpression: ds_${clusterId.hashCode().abs() % 2}
     bindingTables:
       - t_cluster,t_cluster_instance
     defaultDatabaseStrategy:
       none:
     defaultTableStrategy:
       none:
   ```
   ### Example codes for reproduce this issue (such as a github link).
   #### test sql
   ```sql
   select * from t_cluster order by clusterId;
   ```
   #### enviroment
   table t_cluster no data
   #### expected result
   `return no data`
   #### actual result
   `cann't get result, query is executing, no response`
   
![image](https://user-images.githubusercontent.com/19368482/76139087-068dda80-6088-11ea-8e35-20010140bbf8.png)
   #### log
   ##### sharding-proxy
   
![image](https://user-images.githubusercontent.com/19368482/76139104-2c1ae400-6088-11ea-8e45-84f053695108.png)
   ##### mysql
   
![image](https://user-images.githubusercontent.com/19368482/76139114-3dfc8700-6088-11ea-9753-7608fdd8f76a.png)
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to