You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/05/08 06:41:06 UTC

[GitHub] [shardingsphere] luoyihang opened a new issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed?

luoyihang opened a new issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464


   ## Question
   
   has the bug like https://github.com/apache/shardingsphere/issues/4746 been fixed in 4.1.0?
   When i use `select * from xxx` with Mysql, the return result is still null in `Select One Record`


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464#issuecomment-626352430


   Can you show your sharding rule configuration and log of `sql.show`?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tuohai666 closed issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
tuohai666 closed issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] luoyihang commented on issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
luoyihang commented on issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464#issuecomment-638690870


   It was shown in my last comment
   
   sql.show log
   ```
   2020-05-11 08:43:38,158 [INFO ] 97e4453ac64a19d0 [http-nio-8080-exec-1] [ShardingSphere-SQL.74] Logic SQL: select * from t_person where userName = ?
   2020-05-11 08:43:38,158 [INFO ] 97e4453ac64a19d0 [http-nio-8080-exec-1] [ShardingSphere-SQL.74] SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@42034e98, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@64e14ed8), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@64e14ed8, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7, distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty, actualColumns=[])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@749add2a, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@20247c70, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@788b9162, containsSubquery=false)
   2020-05-11 08:43:38,158 [INFO ] 97e4453ac64a19d0 [http-nio-8080-exec-1] [ShardingSphere-SQL.74] Actual SQL: test0 ::: select * from t_person_0 where userName = ? ::: [aa]
   ```
   any more else?
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] luoyihang commented on issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
luoyihang commented on issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464#issuecomment-626417607


   sql with Mybatis xml
   ```sql
   select * from t_person where userName = #{userName}
   ```
   
   config
   ```yaml
   tables:
     t_person:
       actualDataNodes: ds.t_person
       tableStrategy:
         complex:
           shardingColumns: userName
           algorithmClassName: com.xxx.PersonShardingAlgorithm
   ```
   
   PersonShardingAlgorithm
   ```Java
   public class PersonShardingAlgorithm implements ComplexKeysShardingAlgorithm<String> {
   
       private static final String SHARDING_KEY = "userName";
   
       @Override
       public Collection<String> doSharding(Collection<String> collection, ComplexKeysShardingValue<String> complexKeysShardingValue) {
           List<String> retVal = new ArrayList<>();
           retVal.add("t_person" + complexKeysShardingValue.getColumnNameAndShardingValuesMap().get(SHARDING_KEY).hashCode() % 2);
           return retVal;
       }
   }
   ```
   
   log
   ```log
   2020-05-11 08:43:38,158 [INFO ] 97e4453ac64a19d0 [http-nio-8080-exec-1] [ShardingSphere-SQL.74] Logic SQL: select * from t_person where userName = ?
   2020-05-11 08:43:38,158 [INFO ] 97e4453ac64a19d0 [http-nio-8080-exec-1] [ShardingSphere-SQL.74] SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@42034e98, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@64e14ed8), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@64e14ed8, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7, distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty, actualColumns=[])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@749add2a, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@20247c70, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@788b9162, containsSubquery=false)
   2020-05-11 08:43:38,158 [INFO ] 97e4453ac64a19d0 [http-nio-8080-exec-1] [ShardingSphere-SQL.74] Actual SQL: test0 ::: select * from t_person_0 where userName = ? ::: [aa]
   ```
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tuohai666 commented on issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464#issuecomment-639257937


   1. Is there any Exception in Proxy or your client?
   2. What do you mean when you refer 'the result is null', can you show the output of your client?
   3. Connect to `test0` database and execute SQL `select * from t_person_0 where userName = ?` via an MySQL CLI,  show the output of your client.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tuohai666 commented on issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464#issuecomment-638686965


   The release 4.1.0 include https://github.com/apache/shardingsphere/pull/4759 which fixd this problem.
   
   Can you show more logs with sql.show active?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] luoyihang commented on issue #5464: the bug with "Select * from with Mysql, Select One Record But return null " is fixed in 4.1.0?

Posted by GitBox <gi...@apache.org>.
luoyihang commented on issue #5464:
URL: https://github.com/apache/shardingsphere/issues/5464#issuecomment-643023055


   I try it again with same config, and it works


----------------------------------------------------------------
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:
users@infra.apache.org