Setting max_statement_time per query has no effect

Bug #1376934 reported by David Turner on 2014-10-02
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Vlad Lesin
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Vlad Lesin

Bug Description

Cut and paste from developer:

> Do we have a good way of reporting bugs to Percona? I think I found some misbehavior.
>
> SET STATEMENT max_statement_time=1000 FOR SELECT * FROM server_file_journal
> seems to ignore the max_statement_time. Setting a max_statement_time at the session level works fine.
>
> http://www.percona.com/blog/2013/11/07/using-per-query-variable-statements-in-percona-server/)

Related branches

tags: added: i46411
tags: added: set-statement
Muhammad Irfan (muhammad-irfan) wrote :
Download full text (4.6 KiB)

I am able to reproduce this problem. max_statement_time works as expected when set on session level or global level (in my.cnf) but fails to work correctly when set on query level with SET STATEMENT. I tested on on Percona Server 5.6.16/5.6.20

mysql [localhost] {msandbox} (world) > show global variables like '%version%';
+-------------------------+-----------------------------------------------------------------+
| Variable_name | Value |
+-------------------------+-----------------------------------------------------------------+
| innodb_version | 5.6.16-rel64.1 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.6.16-64.1-rel64.1-log |
| version_comment | Percona Server with XtraDB (GPL), Release rel64.1, Revision 563 |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+-----------------------------------------------------------------+

mysql [localhost] {msandbox} (world) > show global variables like '%version%';
+-------------------------+--------------------------------------------------+
| Variable_name | Value |
+-------------------------+--------------------------------------------------+
| innodb_version | 5.6.20-rel68.0 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.6.20-68.0 |
| version_comment | Percona Server (GPL), Release 68.0, Revision 656 |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+--------------------------------------------------+

When set max_statement_time variable in my.cnf it works as expected as per below test results.

mysql [localhost] {msandbox} (world) > SELECT * FROM Country GROUP BY HeadOfState ORDER BY Continent;
ERROR 1882 (70101): Query execution was interrupted, max_statement_time exceeded

mysql [localhost] {msandbox} (world) > SELECT * FROM CountryLanguage GROUP BY IsOfficial ORDER BY Percentage DESC;
ERROR 1882 (70101): Query execution was interrupted, max_statement_time exceeded

Again, when one set on session level, it works correctly.

mysql [localhost] {msandbox} (world) > SET SESSION max_statement_time=1;
Query OK, 0 rows affected (0.00 sec)

mysql [localhost] {msandbox} ((none)) > SHOW VARIABLES LIKE 'max_statement_time';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_statement_time | 1 |
+--------------------+-------+
1 row i...

Read more...

Changed in percona-server:
status: New → Confirmed
tags: added: max-statement-time
summary: - per query variable statements failing
+ Setting max_statement_time per query has no effect

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1542

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers