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/12/25 03:51:09 UTC

[GitHub] [shardingsphere] Nononoa-Zoro opened a new issue #8770: How to config sharding sphere ?

Nononoa-Zoro opened a new issue #8770:
URL: https://github.com/apache/shardingsphere/issues/8770


   The scene is , I have tab_user,tab_role two tables , and ds0,ds1 two database.
   The follow is DDL  of tab_user and tab_role:
   -------
   DROP TABLE IF EXISTS `tab_user`;
   CREATE TABLE `tab_user`  (
     `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT ,
     `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
     `age` int(11) NULL DEFAULT NULL COMMENT ,
     `create_time` datetime(0) NULL DEFAULT NULL COMMENT ,
     `update_time` datetime(0) NULL DEFAULT NULL COMMENT ,
     `status` tinyint(1) NULL DEFAULT NULL COMMENT ,
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
   
   SET FOREIGN_KEY_CHECKS = 1;
   -------
   DROP TABLE IF EXISTS `tab_role`;
   CREATE TABLE `tab_role`  (
     `id` int(11) NOT NULL COMMENT ,
     `role_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
   
   SET FOREIGN_KEY_CHECKS = 1;
   -------
   
   My sharding strategy of database is based of column age, and both tab_user and tab_role have the column age , but the two tables is accosiated by column `id`.
   when i execute sql as follows:
   
   Logic SQL: select *
       from tab_user u,tab_role r
       where u.id = r.id and u.id = ?
   
   Actual SQL: ds0 ::: select *
       from tab_user u,tab_role r
       where u.id = r.id and u.id = ? ::: [2]
   
   in application.properties if i didn't config like follows :
   spring.shardingsphere.sharding.default-data-source-name=ds0
   the application will not start successfully
   
   My question is that is there any solution can help execute such accosiation sql in all actual db instead of default db ?
   
   


----------------------------------------------------------------
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] yu199195 commented on issue #8770: How to config sharding sphere ?

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


   what version used by?   can you show sharding config?


----------------------------------------------------------------
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 #8770: How to config sharding sphere ?

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


   Closed because of no response.


----------------------------------------------------------------
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 closed issue #8770: How to config sharding sphere ?

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


   


----------------------------------------------------------------
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 #8770: How to config sharding sphere ?

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


   The title is too generic, can you change it for search friendly?


----------------------------------------------------------------
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