--tc-heuristic-recover option values are broken

Bug #1334330 reported by Laurynas Biveinis
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Laurynas Biveinis
5.1
Won't Fix
Undecided
Unassigned
5.5
Won't Fix
Undecided
Unassigned
5.6
Fix Released
Medium
Laurynas Biveinis

Bug Description

Copy of http://bugs.mysql.com/bug.php?id=70860:

[8 Nov 2013 10:20] Laurynas Biveinis
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:

#define TC_HEURISTIC_RECOVER_COMMIT 1
#define TC_HEURISTIC_RECOVER_ROLLBACK 2

How to repeat:
Set up the server for 2 XA SEs as in bug 70854, then start the server under the debugger with --tc-heuristic-recover=ROLLBACK, set a breakpoint on ha_recover() (by the time of its call tc_heuristic_recover variable must be set up):

Breakpoint 2, ha_recover (commit_list=0x0) at /home/laurynas/percona/src/mysql-server/sql/handler.cc:1846
1846 DBUG_ENTER("ha_recover");
(gdb) print tc_heuristic_recover
$1 = 1

that is it's, equal to TC_HEURISTIC_RECOVER_COMMIT instead.

Suggested fix:
Re-enumerating the #defines to start from 0 won't work, as zero value for tc_heuristic_recover should mean that the option was not specified at all.

I'd consider adding "NONE" as the 1st allowed option value and the default.

Related branches

tags: added: tokudb upstream
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-1514

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.