-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 in "left join" statement #20510
Comments
#19620 is supposed to fix this issue. |
Closed by #19620 |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
This appears to be a regression or not fixed correctly: tidb> SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not((t1.a=30 and t2.b=1));
+---+------+------+------+
| a | b | a | b |
+---+------+------+------+
| 1 | 1 | 1 | 2 |
| 2 | 1 | 2 | 2 |
| 3 | 1 | NULL | NULL |
| 4 | 2 | NULL | NULL |
+---+------+------+------+
4 rows in set (0.00 sec)
tidb> SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not(0+(t1.a=30 and t2.b=1));
+---+------+------+------+
| a | b | a | b |
+---+------+------+------+
| 1 | 1 | 1 | 2 |
| 2 | 1 | 2 | 2 |
+---+------+------+------+
2 rows in set (0.00 sec)
tidb> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.4.0-alpha-305-gcec4acbf5
Edition: Community
Git Commit Hash: cec4acbf5ea952a8f92c8258fce3142528f9fb1e
Git Branch: master
UTC Build Time: 2021-12-02 18:57:09
GoVersion: go1.16.9
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
/assign @rebelice |
I have tested it. The selection is wrongly pushed to join. |
|
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
mysql 8.0.21
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master 937949f and release-4.0 2f62191
The text was updated successfully, but these errors were encountered: