Description:
I recently got this error message by incorrectly providing a valid gtid_set.
root@host [(none)]> set global gtid_purged = 'ac54bd7-1408-11e4-8ad2-fc15b40b0c68:29339039-47562835,5ce59847-80cb-11e6-ae2f-fc15b40b0c68:1-132906235,6128a9ac-549d-11e7-bd28-8cdcd41d0600:1-52548401,64fa2562-573b-11e7-9bb1-5cb901da7410:1-183604199,740de8a1-1850-11e7-bf4a-246e96133050:1-3812427,891f7a1a-86e3-11e6-8272-246e961697f0:1-51406701,aafddb47-170c-11e4-9e7e-fc15b40a0ca8:1-63219024,c55d810b-54b1-11e7-8f26-9cdc71ced190:1-4';
ERROR 1231 (42000): Variable 'gtid_purged' can't be set to the value of 'ac54bd7-1408-11e4-8ad2-fc15b40b0c68:29339039-47562835,5ce59847-80cb-11e6-ae2f-fc15b40b0c68:1-132906235,6128a9ac-549d-11e7-bd28-8cdcd41d0600:1-52548401,64fa2562-573b-11e7-9bb1-5cb901da7410:1-183604199,'
root@host [(none)]>
GTID sets can get quite large if you switch masters frequently and I had to resolve an issue with a rogue transaction inserted into the slave.
The cause of the error was the incomplete uuid value which was missing a digit. Sometime this is not very visible given the rather non-human-friendly content of gtid_executed or gtid_purged.
How to repeat:
see above.
Suggested fix:
Change the error message to be more precise. Something like:
Variable 'gtid_purged' can't be set to the value requested: invalid uuid 'ac54bd7-1408-11e4-8ad2-fc15b40b0c68' specified.
This is much easier to understand and therefore correct.
In other cases try to provide a bit more context as to the problem.