-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Wrong result caused by misuse of batch-point-get #19191
Labels
Comments
/label severity/critical |
/assign @zz-jason |
ghost
added
the
correctness
label
Aug 14, 2020
Verified I can reproduce against master. Just to expand the testcase to prove this is not an operator precedence issue: drop table if exists t;
create table t (c_int int, c_str varchar(40), primary key(c_int, c_str));
insert into t values (3, 'friendly bose');
select * from t where c_int in (3);
select * from t where c_int in (3) or c_str in ('gifted yalow') and c_int in (1, 2); -- incorrect
select * from t where c_int in (3) or (c_str in ('gifted yalow') and c_int in (1, 2)); -- incorrect
select * from t where c_int in (3) or (false); -- correct
..
mysql> select * from t where c_int in (3) or c_str in ('gifted yalow') and c_int in (1, 2); -- incorrect
Empty set (0.00 sec)
mysql> select * from t where c_int in (3) or (c_str in ('gifted yalow') and c_int in (1, 2)); -- incorrect
Empty set (0.00 sec)
mysql> select * from t where c_int in (3) or (false); -- correct
+-------+---------------+
| c_int | c_str |
+-------+---------------+
| 3 | friendly bose |
+-------+---------------+
1 row in set (0.00 sec)
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-947-g84e07a2a5
Edition: Community
Git Commit Hash: 84e07a2a593b6dd9a85712f1910883e5f7281b07
Git Branch: master
UTC Build Time: 2020-08-12 08:42:23
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Both selection should return:
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master @ 84e07a2
release-4.0 @ 1483de3
The text was updated successfully, but these errors were encountered: