Bug #83339 mysqldump fails due to max_execution_time with no override possible
Submitted: 11 Oct 2016 19:45 Modified: 7 May 2019 20:20
Reporter: monty solomon Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:5.7.13, 5.7.15, 5.7.25 OS:CentOS
Assigned to: CPU Architecture:Any

[11 Oct 2016 19:45] monty solomon
Description:
mysqldump fails to complete when the SELECT statement it executes exceeds the max_execution_time.

There does not appear to be any method to specify an optimizer hint to override it.

How to repeat:
Set a max execution time

SET GLOBAL max_execution_time=10000;

Run mysqldump on a large table and get an error

mysqldump --single-transaction --databases test --tables foo --set-gtid-purged=OFF -r foo.sql

mysqldump: Error 3024: Query execution was interrupted, maximum statement execution time exceeded when dumping table `foo` at row: 28622814

mysqldump executed this statement

2016-10-11T18:28:18.975770Z1670957 Query	SELECT /*!40001 SQL_NO_CACHE */ * FROM `foo`

Suggested fix:
Add the ability to specify a MAX_EXECUTION_TIME optimizer hint to mysqldump.

mysqldump should use a default optimizer hint setting of no limit --  /*+ MAX_EXECUTION_TIME(0) */
[12 Oct 2016 7:04] MySQL Verification Team
Hello Monty,

Thank you for the report and reasonable feature request.

Thanks,
Umesh
[7 May 2019 20:20] monty solomon
I suggested using /*+ MAX_EXECUTION_TIME(0) */ to specify no limit but 0 means use the current setting.

Use something like /*+ MAX_EXECUTION_TIME(999999999) */ for "no limit"
[22 Jul 2019 10:31] feng guo
It has been 3years since this bug was reported, what's status now?
[25 Oct 2020 10:44] xan dark
Now It has been 4 years since this bug was reported.
There is any chance to see this fixed?
Thanks
[9 Feb 2021 11:41] Reinhard Jonas
Still no patch awailable?
MySQL 5.7.32
R.J.
[28 Feb 2022 0:17] Christos Chatzaras
Is it possible to change the max_execution_time in my.cnf like this?

[mysql]
max_execution_time=300000

[mysqldump]
max_execution_time=0