Affects Version/s: None
Fix Version/s: None
**Reported in Launchpad by Laurynas Biveinis last update 29-07-2014 13:01:44
[8 Nov 2013 10:20] Laurynas Biveinis
--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
(gdb) print tc_heuristic_recover
$1 = 1
that is it's, equal to TC_HEURISTIC_RECOVER_COMMIT instead.
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.