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 2022/07/21 08:13:23 UTC

[GitHub] [shardingsphere] marker-wu opened a new issue, #19423: A bug in the binding table at version 5.1.1

marker-wu opened a new issue, #19423:
URL: https://github.com/apache/shardingsphere/issues/19423

   A bug in the binding table, the table is divided according to order_id and user_id, and an exception is displayed
   ![image](https://user-images.githubusercontent.com/45256940/180164179-ab82b571-4586-43c3-bcf3-2bc1e70c3b7b.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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1200897307

   > @marker-wu How can the prefix be accurately identified?
   
   enhanced on the basis of the original regular, the real table contains a set of rules: numbers and -or_ (can exist multiple times), and finally ends with number
   original:      Pattern.compile("\\d+$");
   modify to :  Pattern.compile("(\\d+[\\-_]){0,}(\\d+$)");


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] tuichenchuxin commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by "tuichenchuxin (via GitHub)" <gi...@apache.org>.
tuichenchuxin commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1415063261

   I found if we use logic table like `t_order0226_1` and will get this logic prefix `t_order`.
   This result is confusing. I think we should just support stripping the number endings.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1200376868

   > Why not use `t_order_00`, `t_order_01`?
   I divided the table according to multiple fields
   ![image](https://user-images.githubusercontent.com/45256940/182017372-d51e5d79-a548-4355-94f5-14a6b52e0876.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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TW-haiyuan commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
TW-haiyuan commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1202170873

   @strongduanmu  hi, i am using shardingsphere jdbc 5.1.1 and also meet this problem. But the type of binding tables' sharding key i used is string, now the shardingsphere use "\\d+$" to get actualDataNodes' suffix. I want to know why choose to use numbers as the rule, will other types (like string) be added in the future?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] inotgaoshou commented on issue #19423: A bug in the binding table at version 5.1.1

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

   I don't quite understand the configuration or meaning of the binding table. My problem now is that the table users in the associated table cannot be recognized, because the users table is in another database。
   add java code like this?
   ```
     shardingRuleConfig.getBroadcastTables().add("users");
   ```


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1200936750

   > Looks great, you can raise a pr to fix this bug.
   
   OK,I'll do it after get off work


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   @marker-wu How can the prefix be accurately identified?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1200916733

   > @marker-wu Can you give some test case to show the result.
   
   here are my test result:
   ![image](https://user-images.githubusercontent.com/45256940/182112493-0a0ab7ba-93af-424b-9903-3adc546d9bcd.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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   Ok, I will check this bug.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu closed issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #19423: A bug in the binding table at version 5.1.1
URL: https://github.com/apache/shardingsphere/issues/19423


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1202201944

   > @strongduanmu hi, i am using shardingsphere jdbc 5.1.1 and also meet this problem. But the type of binding tables' sharding key i used is string, now the shardingsphere use "\d+$" to get actualDataNodes' suffix. I want to know why choose to use numbers as the rule, will other types (like string) be added in the future?
   
   Usually, the suffixes of the partition table are all numbers, and the binding table requires the same partition rules. Numbers are more friendly than letters during verification, and it is difficult to specify verification rules with letters. In addition, the purpose of our sub-table is for better routing later. Common sharding algorithms such as: hash modulo, time, range, etc. These suffixes are all numbers. If you want to divide the table according to letters, you can convert it to numbers by hash algorithm. this is my understanding


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   @marker-wu Which version do you use?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1191202556

   > @marker-wu Which version do you use?
   
   5.1.1


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   Why not use `t_order_00`, `t_order_01`?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   @TW-haiyuan Adding a numeric suffix may be a hidden specification. I don't think we should pay too much attention to the suffix, after all users don't need to pay attention to the actual table, what do you think?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1200375374

   > @marker-wu Can you try the latest version? I can not reproduce this exception with master branch.
   I tried the latest version and it still doesn't work
   The problem seems to be in the assignment of tableDataNode.prefix, the correct value should be t_order
   ![image](https://user-images.githubusercontent.com/45256940/182016574-fe7dcc12-cbb8-43d9-863d-edfe5f5c8cd8.png)
   
   here are my physical table,Did you test with the same scene as I did?
   ![image](https://user-images.githubusercontent.com/45256940/182016927-3ff2733c-35a0-4eb7-a719-b3fb46705089.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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] marker-wu commented on issue #19423: A bug in the binding table at version 5.1.1

Posted by GitBox <gi...@apache.org>.
marker-wu commented on issue #19423:
URL: https://github.com/apache/shardingsphere/issues/19423#issuecomment-1200378956

   It should be a problem with this regex,can I fork it and fix it?
   ![image](https://user-images.githubusercontent.com/45256940/182017651-9290fe1c-17f6-4213-9f46-7fa27b4eea7d.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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   @marker-wu Can you give some test case to show the result.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   @marker-wu Looks great, you can raise a pr to fix this bug.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #19423: A bug in the binding table at version 5.1.1

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

   @marker-wu Can you try the latest version? I can not reproduce this exception with master branch.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org