-
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
Encounter Error 1242: Subquery returns more than 1 row when running TPCH Q11 with tidb_enforce_mpp=1 #32632
Labels
Comments
ti-chi-bot
added
may-affects-4.0
This bug maybe affects 4.0.x versions.
may-affects-5.0
This bug maybe affects 5.0.x versions.
may-affects-5.1
This bug maybe affects 5.1.x versions.
may-affects-5.2
This bug maybe affects 5.2.x versions.
may-affects-5.3
This bug maybe affects 5.3.x versions.
may-affects-5.4
This bug maybe affects 5.4.x versions.
labels
Feb 28, 2022
break on pull #32336, only affects master |
smaller reproduce: set tidb_enforce_mpp=1; select sum(ps_supplycost) from partsupp, supplier where ps_suppkey = s_suppkey; expect Query OK, 0 rows affected (0.00 sec)
+--------------------+
| sum(ps_supplycost) |
+--------------------+
| 400420638.54 |
+--------------------+
1 row in set (0.28 sec)
mysql> explain analyze select sum(ps_supplycost) from partsupp, supplier where ps_suppkey = s_suppkey;
+--------------------------------------------+-----------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+---------+------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+--------------------------------------------+-----------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+---------+------+
| HashAgg_44 | 1.00 | 1 | root | | time:101.5ms, loops:2, partial_worker:{wall_time:101.491405ms, concurrency:5, task_num:1, tot_wait:507.200573ms, tot_exec:6.39µs, tot_time:507.217008ms, max:101.463196ms, p95:101.463196ms}, final_worker:{wall_time:101.50267ms, concurrency:5, task_num:1, tot_wait:507.241714ms, tot_exec:21.792µs, tot_time:507.294917ms, max:101.478277ms, p95:101.478277ms} | funcs:sum(Column#15)->Column#14 | 18.0 KB | N/A |
| └─TableReader_46 | 1.00 | 2 | root | | time:101.4ms, loops:2, cop_task: {num: 2, max: 0s, min: 0s, avg: 0s, p95: 0s, copr_cache_hit_ratio: 0.00} | data:ExchangeSender_45 | N/A | N/A |
| └─ExchangeSender_45 | 1.00 | 2 | batchCop[tiflash] | | tiflash_task:{proc max:54ms, min:34.4ms, p80:54ms, p95:54ms, iters:2, tasks:2, threads:40} | ExchangeType: PassThrough | N/A | N/A |
| └─HashAgg_12 | 1.00 | 2 | batchCop[tiflash] | | tiflash_task:{proc max:53ms, min:33.4ms, p80:53ms, p95:53ms, iters:2, tasks:2, threads:2} | funcs:sum(test.partsupp.ps_supplycost)->Column#15 | N/A | N/A |
| └─Projection_42 | 800000.00 | 800000 | batchCop[tiflash] | | tiflash_task:{proc max:53ms, min:33.4ms, p80:53ms, p95:53ms, iters:13, tasks:2, threads:40} | test.partsupp.ps_supplycost | N/A | N/A |
| └─HashJoin_43 | 800000.00 | 800000 | batchCop[tiflash] | | tiflash_task:{proc max:53ms, min:33.4ms, p80:53ms, p95:53ms, iters:13, tasks:2, threads:40} | inner join, equal:[eq(test.supplier.s_suppkey, test.partsupp.ps_suppkey)] | N/A | N/A |
| ├─ExchangeReceiver_29(Build) | 10000.00 | 20000 | batchCop[tiflash] | | tiflash_task:{proc max:22ms, min:12.4ms, p80:22ms, p95:22ms, iters:2, tasks:2, threads:40} | | N/A | N/A |
| │ └─ExchangeSender_28 | 10000.00 | 10000 | batchCop[tiflash] | | tiflash_task:{proc max:3.53ms, min:0s, p80:3.53ms, p95:3.53ms, iters:1, tasks:2, threads:1} | ExchangeType: Broadcast | N/A | N/A |
| │ └─TableFullScan_27 | 10000.00 | 10000 | batchCop[tiflash] | table:supplier | tiflash_task:{proc max:3.53ms, min:0s, p80:3.53ms, p95:3.53ms, iters:1, tasks:2, threads:1} | keep order:false | N/A | N/A |
| └─TableFullScan_30(Probe) | 800000.00 | 800000 | batchCop[tiflash] | table:partsupp | tiflash_task:{proc max:32ms, min:28.4ms, p80:32ms, p95:32ms, iters:13, tasks:2, threads:2} | keep order:false | N/A | N/A |
+--------------------------------------------+-----------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+---------+------+
10 rows in set (0.26 sec)
got: Query OK, 0 rows affected (0.04 sec)
+--------------------+
| sum(ps_supplycost) |
+--------------------+
| 240823020.85 |
| 159597617.69 |
+--------------------+
2 rows in set (0.32 sec)
mysql> explain analyze select sum(ps_supplycost) from partsupp, supplier where ps_suppkey = s_suppkey;
+------------------------------------------+-----------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+--------+------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+------------------------------------------+-----------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+--------+------+
| TableReader_75 | 1.00 | 2 | root | | time:94.2ms, loops:2, cop_task: {num: 3, max: 0s, min: 0s, avg: 0s, p95: 0s, copr_cache_hit_ratio: 0.00} | data:ExchangeSender_74 | N/A | N/A |
| └─ExchangeSender_74 | 1.00 | 2 | batchCop[tiflash] | | tiflash_task:{proc max:46.9ms, min:31.9ms, p80:46.9ms, p95:46.9ms, iters:2, tasks:2, threads:40} | ExchangeType: PassThrough | N/A | N/A |
| └─StreamAgg_15 | 1.00 | 2 | batchCop[tiflash] | | tiflash_task:{proc max:46.9ms, min:31.9ms, p80:46.9ms, p95:46.9ms, iters:2, tasks:2, threads:2} | funcs:sum(test.partsupp.ps_supplycost)->Column#14 | N/A | N/A |
| └─Projection_73 | 800000.00 | 800000 | batchCop[tiflash] | | tiflash_task:{proc max:46.9ms, min:31.9ms, p80:46.9ms, p95:46.9ms, iters:13, tasks:2, threads:40} | test.partsupp.ps_supplycost | N/A | N/A |
| └─HashJoin_69 | 800000.00 | 800000 | batchCop[tiflash] | | tiflash_task:{proc max:46.9ms, min:31.9ms, p80:46.9ms, p95:46.9ms, iters:13, tasks:2, threads:40} | inner join, equal:[eq(test.supplier.s_suppkey, test.partsupp.ps_suppkey)] | N/A | N/A |
| ├─ExchangeReceiver_32(Build) | 10000.00 | 20000 | batchCop[tiflash] | | tiflash_task:{proc max:21.9ms, min:13.9ms, p80:21.9ms, p95:21.9ms, iters:2, tasks:2, threads:40} | | N/A | N/A |
| │ └─ExchangeSender_31 | 10000.00 | 10000 | batchCop[tiflash] | | tiflash_task:{proc max:4.55ms, min:0s, p80:4.55ms, p95:4.55ms, iters:1, tasks:2, threads:1} | ExchangeType: Broadcast | N/A | N/A |
| │ └─TableFullScan_30 | 10000.00 | 10000 | batchCop[tiflash] | table:supplier | tiflash_task:{proc max:4.55ms, min:0s, p80:4.55ms, p95:4.55ms, iters:1, tasks:2, threads:1} | keep order:false | N/A | N/A |
| └─TableFullScan_33(Probe) | 800000.00 | 800000 | batchCop[tiflash] | table:partsupp | tiflash_task:{proc max:37.9ms, min:24.9ms, p80:37.9ms, p95:37.9ms, iters:13, tasks:2, threads:2} | keep order:false | N/A | N/A |
+------------------------------------------+-----------+---------+-------------------+----------------+----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+--------+------+
9 rows in set (0.29 sec) |
LittleFall
added
severity/critical
and removed
severity/major
may-affects-4.0
This bug maybe affects 4.0.x versions.
may-affects-5.1
This bug maybe affects 5.1.x versions.
may-affects-5.2
This bug maybe affects 5.2.x versions.
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-5.0
This bug maybe affects 5.0.x versions.
labels
Mar 1, 2022
12 tasks
ti-chi-bot
pushed a commit
that referenced
this issue
Mar 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
The query is executed without error.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
topo file
The text was updated successfully, but these errors were encountered: