The patch changes file mysql-test/suite/engines/funcs/t/rpl_variables.test,
but not mysql-test/suite/engines/funcs/t/rpl_variables.result. Sounds like you
never actually ran this test?
(I'm not sure what the engines/funcs/ suite is actually used for, you should
double-check that or maybe better make the test in another place, like
mysql-test/suite/rpl/ for example).
Please also make sure that the tests actually fail with the code part of the
patch missing, and that it tests most important part of the functionality.
Also, please write up some text suitable for documentation in the
knowledge base.
The code part of the patch looks good now, I think, using statistic_increment
seems appropriate.
> Wasn't sure if I needed a mutex around this to account for potential
> parallel replication error faults occurring at the same time (probably yes).
Yes, you will need a mutex when setting and reading. Or you can use an atomic
increment and corresponding atomic read.
It's not just for parallel replication, also for multi-source.