[MDEV-9493]  --tc-heuristic-recover option values off by one Created: 2016-01-29  Updated: 2020-08-25  Resolved: 2016-04-20

Status: Closed
Project: MariaDB Server
Component/s: XA
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 5.5.49, 10.0.25, 10.1.14

Type: Bug Priority: Critical
Reporter: Hartmut Holzgraefe Assignee: Sergei Golubchik
Resolution: Fixed Votes: 2
Labels: upstream-fixed


 Description   

--tc-heuristic-recover option values are broken due to option parser enumerating them starting from 0 and the source code enumerating them starting from 1:

sql/mysqld.c:
static const char *tc_heuristic_recover_names[]=
{
  "COMMIT", "ROLLBACK", NullS
};
 
sql/sql_class.h:
#define TC_HEURISTIC_RECOVER_COMMIT   1
#define TC_HEURISTIC_RECOVER_ROLLBACK 2

Percona has fixed this by adding "NONE" as first option, MySQL 5.7 by adding "OFF"



 Comments   
Comment by Hartmut Holzgraefe [ 2016-01-29 ]

https://bugs.mysql.com/bug.php?id=70860

https://bugs.launchpad.net/percona-server/+bug/1334330

Comment by Elena Stepanova [ 2016-02-27 ]

Fixed in 5.7

Comment by Elena Stepanova [ 2016-02-29 ]

The test case from the upstream bug report does not quite work for us, but all the same, the values are mixed up – when it's started with ROLLBACK, it attempts to commit, and vice versa. Also, when it tries to commit, we are getting an assertion failure, but that's a different story.

Generated at Thu Feb 08 07:35:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.