-
Notifications
You must be signed in to change notification settings - Fork 6k
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.report/customerCustomers have encountered this bug.Customers have encountered this bug.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
- Start the TiDB cluster:
tiup playground v8.1.0
- Use sysbench to create a table and insert 100000 rows:
sysbench oltp_insert --table-size=100000 --mysql-db=test --mysql-user=root --mysql-port=4000 --mysql-host=127.0.0.1 prepare
sysbench oltp_insert --table-size=100000 --mysql-db=test --mysql-user=root --mysql-port=4000 --mysql-host=127.0.0.1 run
- Try following SQLs:
use test;
create table sbtest2 like sbtest1;
insert into sbtest2 select * from sbtest1;
create table sbtest3 like sbtest1;
- Try this SQLs with hint:
replace into sbtest3 select /*+ memory_quota(2 GB) */ a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000;
create global binding for replace into sbtest3 select a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000 using replace into sbtest3 select /*+ memory_quota(2 GB) */ a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000;
replace into sbtest3 select a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000;
2. What did you expect to see? (Required)
All queries canceled by memory controller.
3. What did you see instead (Required)
mysql> replace into sbtest3 select /*+ memory_quota(2 GB) */ a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000;
ERROR 8175 (HY000): Your query has been cancelled due to exceeding the allowed memory limit for a single SQL query. Please try narrowing your query scope or increase the tidb_mem_quota_query limit and try again.[conn=4011851786]
mysql> create global binding for replace into sbtest3 select a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000 using replace into sbtest3 select /*+ memory_quota(2 GB) */ a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000;
Query OK, 0 rows affected (0.01 sec)
mysql> replace into sbtest3 select a.* from sbtest1 a, sbtest2 b where a.pad=b.pad limit 0,10000;
Query OK, 10000 rows affected (0.34 sec)
Records: 10000 Duplicates: 0 Warnings: 0
4. What is your TiDB version? (Required)
v8.1.0
Metadata
Metadata
Assignees
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.report/customerCustomers have encountered this bug.Customers have encountered this bug.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.