Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router result is not accurate when condition is "between ... and " #477

Closed
yanhuqing666 opened this issue Mar 21, 2018 · 1 comment
Closed

Comments

@yanhuqing666
Copy link
Member

yanhuqing666 commented Mar 21, 2018

for example:
now the router result is that:

mysql> explain select * from sharding_four_node where id between 0 and 2;
+-----------+----------+---------------------------------------------------------------------+
| DATA_NODE | TYPE     | SQL/REF                                                             |
+-----------+----------+---------------------------------------------------------------------+
| dn1       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
| dn2       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
| dn3       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
| dn4       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
+-----------+----------+---------------------------------------------------------------------+

but we expected is

+-----------+----------+---------------------------------------------------------------------+
| DATA_NODE | TYPE     | SQL/REF                                                             |
+-----------+----------+---------------------------------------------------------------------+
| dn1       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
| dn2       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
| dn3       | BASE SQL | SELECT * FROM sharding_four_node WHERE id BETWEEN 0 AND 2 LIMIT 100 |
+-----------+----------+---------------------------------------------------------------------+
3 rows in set (0.00 sec)
@yanhuqing666 yanhuqing666 added this to the 2.18.02.0 milestone Mar 21, 2018
yanhuqing666 added a commit that referenced this issue Mar 21, 2018
yanhuqing666 added a commit that referenced this issue Mar 23, 2018
@yanhuqing666
Copy link
Member Author

There is an special case in "test between begin and end" is that begin or end is an expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants