-
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
The result of ‘group by having' is incorrect #23499
Comments
When trying to remove duplicated exprs in |
The similar situation was found with MySQL > drop table if exists t;
-> create table t (col1 varbinary(20));
-> insert into t values (0xf4c7abc4c0140a574bf170ffe31ad3bbac890017), (0xe62746d3b7c0c96314550eb81a7e00adcf0de010), (0x91d8445f6d7b739efce0bc69df454aa16827ae73);
-> select t1.col1, t2.col1 from t as t1 inner join t as t2 on t1.col1 = t2.col1 where t1.col1 in (0xE62746D3B7C0C96314550EB81A7E00ADCF0DE010, 0x91D8445F6D7B739EFCE0BC69DF454AA16827AE73, 0xF4C7ABC4C0140A574BF170FFE31AD3BBAC890017)
-> group by t1.col1, t2.col1 having t1.col1 in (0x8958357F32B1E49AD75B0EFE3F63E1F73794A9D2, 0x53EB8734D4A6E12F01507458EA437D326E29A192, 0xBFC1FABBEDEE461D1546492CEB154BA17DC61CF5);
Query OK, 0 rows affected
Time: 0.013s
Query OK, 0 rows affected
Time: 0.005s
Query OK, 3 rows affected
Time: 0.001s
+--------------------------------------------+--------------------------------------------+
| col1 | col1 |
+--------------------------------------------+--------------------------------------------+
| 0x91d8445f6d7b739efce0bc69df454aa16827ae73 | 0x91d8445f6d7b739efce0bc69df454aa16827ae73 |
| 0xf4c7abc4c0140a574bf170ffe31ad3bbac890017 | 0xf4c7abc4c0140a574bf170ffe31ad3bbac890017 |
| 0xe62746d3b7c0c96314550eb81a7e00adcf0de010 | 0xe62746d3b7c0c96314550eb81a7e00adcf0de010 |
+--------------------------------------------+--------------------------------------------+ MySQL : MySQL > drop table if exists t;
-> create table t (col1 varbinary(20));
-> insert into t values (0xf4c7abc4c0140a574bf170ffe31ad3bbac890017), (0xe62746d3b7c0c96314550eb81a7e00adcf0de010), (0x91d8445f6d7b739efce0bc69df454aa16827ae73);
-> select t1.col1, t2.col1 from t as t1 inner join t as t2 on t1.col1 = t2.col1 where t1.col1 in (0xE62746D3B7C0C96314550EB81A7E00ADCF0DE010, 0x91D8445F6D7B739EFCE0BC69DF454AA16827AE73, 0xF4C7ABC4C0140A574BF170FFE31AD3BBAC89001
-> 7) group by t1.col1, t2.col1 having t1.col1 in (0x8958357F32B1E49AD75B0EFE3F63E1F73794A9D2, 0x53EB8734D4A6E12F01507458EA437D326E29A192, 0xBFC1FABBEDEE461D1546492CEB154BA17DC61CF5);
->
->
Query OK, 0 rows affected
Time: 0.299s
Query OK, 0 rows affected
Time: 1.727s
Query OK, 3 rows affected
Time: 0.059s
+------+------+
| col1 | col1 |
+------+------+ |
/assign |
This specific issue has been fixed by #27021. |
Created #30094 to track this issue |
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)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: