A failing LOCK TABLES in SET STATEMENT foo=bar FOR ... may fail to restore the original "foo" value

Bug #1538535 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Triaged
Medium
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

CREATE TABLE t (a INT PRIMARY KEY);

SELECT @@max_sort_length;

XA START '';
--error ER_XAER_RMFAIL
SET STATEMENT max_sort_length=12345 FOR LOCK TABLES t WRITE;
SELECT @@max_sort_length;
XA END '';
XA PREPARE '';
XA COMMIT '';

DROP TABLE t;

will result in

...
SELECT @@max_sort_length;
@@max_sort_length
1024
XA START '';
SET STATEMENT max_sort_length=12345 FOR LOCK TABLES t WRITE;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
SELECT @@max_sort_length;
@@max_sort_length
12345
...

The root cause is similar to that of http://bugs.mysql.com/bug.php?id=80174: an early DBUG_RETURN in mysql_execute.

tags: added: set-statement
summary: - A failing LOCK TABLES in SET STATEMENT foo=bar FOR ... may fail to
+ A failing LOCK TABLES in SET STATEMENT foo=bar FOR ... may fail to the
restore original "foo" value
summary: - A failing LOCK TABLES in SET STATEMENT foo=bar FOR ... may fail to the
- restore original "foo" value
+ A failing LOCK TABLES in SET STATEMENT foo=bar FOR ... may fail to
+ restore the original "foo" value
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.