you've lost the useful comment about STMT_END.
Okay. I just thought that from the reader's perspective it doesn't look important. But you are the reader, and you say it's important. Bringing back.
and you flush events for rollback too that seems like a waste.
I can avoid it, but then we'll have to clear the pending event. Ok i'll do it, i think i didn't see the need to optimize these few bits of rollback.
I personally would've kept the old structure of if()'s.
I like the new one more, as it resembles the symmetry between storing and restoring binlog's position,
and besides it has fewer nesting.