diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-25 12:46:14 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-25 12:46:14 +0100 |
commit | d04bf78af08885e17ebaae7f198f93bbf06817e7 (patch) | |
tree | 7d37b6dd491270481b620cb24ba4dd01edde7dbf /lib/output/pq/updateDatabase.cpp | |
parent | Add before/after event to update position in replication stream (diff) | |
download | mygrate-d04bf78af08885e17ebaae7f198f93bbf06817e7.tar.bz2 mygrate-d04bf78af08885e17ebaae7f198f93bbf06817e7.tar.xz mygrate-d04bf78af08885e17ebaae7f198f93bbf06817e7.zip |
Support the rotate event to move to the next binlog file
Diffstat (limited to 'lib/output/pq/updateDatabase.cpp')
-rw-r--r-- | lib/output/pq/updateDatabase.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/output/pq/updateDatabase.cpp b/lib/output/pq/updateDatabase.cpp index c43d8e4..9db672d 100644 --- a/lib/output/pq/updateDatabase.cpp +++ b/lib/output/pq/updateDatabase.cpp @@ -20,6 +20,7 @@ #include <output/pq/sql/selectSourceSchema.h> #include <output/pq/sql/selectTables.h> #include <output/pq/sql/updateSourcePosition.h> +#include <output/pq/sql/updateSourceRotate.h> #include <row.h> #include <stdexcept> #include <streamSupport.h> @@ -384,4 +385,13 @@ namespace MyGrate::Output::Pq { afterEvent(e); } } + + void + UpdateDatabase::rotate(MariaDB_Event_Ptr e) + { + if ((e->flags & LOG_EVENT_ARTIFICIAL_F) == 0) { + output::pq::sql::updateSourceRotate::execute( + this, *e->event.rotate.filename, e->event.rotate.position, source); + } + } } |