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

planner: final agg should be converted according the its split semantic under MPP mode #46347

Closed
AilinKid opened this issue Aug 23, 2023 · 1 comment
Assignees
Labels
may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@AilinKid
Copy link
Contributor

AilinKid commented Aug 23, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `c` (
  `c_id` int(11) DEFAULT NULL
) 
CREATE TABLE `o` (
  `o_id` int(11) DEFAULT NULL,
  `c_id` int(11) DEFAULT NULL
)
MySQL [test]> select * from c;
+------+
| c_id |
+------+
|    1 |
|    1 |
|    1 |
|    1 |
+------+
4 rows in set (0.003 sec)
MySQL [test]> select * from o;
+------+------+
| o_id | c_id |
+------+------+
|    1 |    1 |
|    1 |    1 |
|    1 |    2 |
+------+------+
3 rows in set (0.003 sec)
MySQL [test]>  select o.o_id, count(*) from c, o where c.c_id=o.o_id group by o.o_id;
+------+----------+
| o_id | count(*) |
+------+----------+
|    1 |        4 |
+------+----------+
1 row in set (0.048 sec)

set replica for this two tables
set @@tidb_enforce_mpp=on
set @@tidb_opt_agg_push_down=1;

2. What did you expect to see? (Required)

MySQL [test]>  select o.o_id, count(*) from c, o where c.c_id=o.o_id group by o.o_id;
+------+----------+
| o_id | count(*) |
+------+----------+
|    1 |       12 |
+------+----------+
1 row in set (0.048 sec)

3. What did you see instead (Required)

MySQL [test]>  select o.o_id, count(*) from c, o where c.c_id=o.o_id group by o.o_id;
+------+----------+
| o_id | count(*) |
+------+----------+
|    1 |        4 |
+------+----------+
1 row in set (0.048 sec)

4. What is your TiDB version? (Required)

master

@AilinKid AilinKid added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner labels Aug 23, 2023
@AilinKid AilinKid self-assigned this Aug 23, 2023
@AilinKid
Copy link
Contributor Author

this issue is quite same with #45850

@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 4, 2023
@AilinKid AilinKid closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants