diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-22 22:22:22 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-22 22:22:22 +0100 |
commit | 14304c9c1d1ee01c6e7b3834deb2b1cc8a8ec740 (patch) | |
tree | 78e6f500d779bf2e8653beba1366903a2be1b26d | |
parent | Do connection level setup in constructor (diff) | |
download | mygrate-14304c9c1d1ee01c6e7b3834deb2b1cc8a8ec740.tar.bz2 mygrate-14304c9c1d1ee01c6e7b3834deb2b1cc8a8ec740.tar.xz mygrate-14304c9c1d1ee01c6e7b3834deb2b1cc8a8ec740.zip |
Only update position after event handler
-rw-r--r-- | lib/input/replStream.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/input/replStream.cpp b/lib/input/replStream.cpp index 7a995d3..f7452e7 100644 --- a/lib/input/replStream.cpp +++ b/lib/input/replStream.cpp @@ -32,10 +32,11 @@ namespace MyGrate::Input { verify<MySQLErr>(!mariadb_rpl_open(rpl.get()), "Failed to mariadb_rpl_open", this); while (MyGrate::MariaDB_Event_Ptr event {mariadb_rpl_fetch(rpl.get(), nullptr), &mariadb_free_rpl_event}) { - position = event->next_event_pos; + auto np = event->next_event_pos; if (const auto & h = eventHandlers.at(event->event_type); h.func) { (eh.*h.func)(std::move(event)); } + position = np; } } |