With fix for CONC-710 (Remove UDF declarations) in 3.1 branch,
we also removed the variable types, which are also used by
the binary log api.
The enumeration for variable types were now added back in
mariadb_rpl.h
When checking for a semi sync indication header, we need also check if
the undocumented session variable @rpl_semi_sync_slave was set.
Otherwise the timestamp of the event could contain values which match
the 2 bytes of the semi sync header.
Since the variable rpl_semi_sync_slave and it's behavior is not documented,
a new option MARIADB_RPL_SEMI_SYNC was added.
Since mariadb_rpl.h is a distributed include file which will be
included by other applications, we need to undefine DEFAULT_CHARSET
in case the application was built without NOGDI.
- All (MariaDB and MySQL) events are now supported
- Added new api functions:
- mariadb_rpl_error: returns error message
- mariadb_rpl_errno: returns error number
- mariadb_rpl_extract_rows: extract values of
ROW_EVENTS
- Added decryption support
- Added uncompression
-
If timestamp is zero and flag LOG_EVEBNT_ARTIFICIAL_F was set the
event is a fake ROTATE_EVENT (https://mariadb.com/kb/en/fake-rotate_event/)
and needs different handling:
- a checksum might follow if @@binlog_checksum was set (CRC32)
- length calculation is different
Beside already supported asynchronous replication
the replication/binlog API now supports semi
synchronous replication:
If an event contains a semi synchronous indicator (0xEF)
behind status byte and acknowledgement flag is set,
mariadb_rpl_fetch() automatically sends an acknowledge
message to the connected primary server.
Binlog checksums are now detected and treated correctly. By subtracting
the checksum size from the event length, end-of-event strings are
calculated correctly. These are used at least in the ROTATE_EVENT which
were also fixed to use the event length stored in the event itself.
The table name is also null-terminated so the length plus one byte needs
to be skipped.
If the table map event is not used immediately after the event is read,
the column types would point to possibly freed memory. To avoid this,
memory should be allocated for it.