-
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
Delete using outer join can mistakenly delete the row whose handle=0 #31321
Comments
The assertion feature introduced in #31547 will report an error when meeting the bug. mysql-test in MergeCI contains such a case, and will therefore fail until the bug is fixed: tk.MustExec("create table t1 (n numeric(10));")
tk.MustExec("create table t2 (n numeric(10));")
tk.MustExec("insert into t2 values (1),(2),(4),(8),(16),(32);")
tk.MustExec("select * from t2 left outer join t1 using (n);")
tk.MustExec("delete t1,t2 from t2 left outer join t1 using (n);")
tk.MustExec("select * from t2 left outer join t1 using (n);")
tk.MustExec("drop table t1,t2 ;") |
The test is called |
Copied from previous investigation: It seems to me that MySQL uses an explicit variable to indicate null rows generated by outer joins.
And there is a check to skip such rows when deleting. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
2 rows:
(0,0)
and(2,2)
, as in MySQL3. What did you see instead (Required)
4. What is your TiDB version? (Required)
tidb_version(): Release Version: v5.5.0-alpha-21-g722303bca
Edition: Community
Git Commit Hash: 722303b
Git Branch: HEAD
UTC Build Time: 2022-01-04 14:53:04
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: