You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
rpl/binlog api fixes:
- Store artifical checksum in event->checksum instead of raw. - Fixed build when builing with external zlib library.
This commit is contained in:
@@ -227,6 +227,7 @@ IF(WITH_EXTERNAL_ZLIB)
|
||||
IF(NOT ZLIB_FOUND)
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
ENDIF()
|
||||
SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${ZLIB_LIBRARIES})
|
||||
ELSE()
|
||||
SET(ZLIB_INCLUDE_DIR "${CC_SOURCE_DIR}/external/zlib")
|
||||
ADD_SUBDIRECTORY("${CC_SOURCE_DIR}/external/zlib")
|
||||
|
@@ -328,7 +328,7 @@ typedef struct st_mariadb_rpl {
|
||||
uint16_t flags;
|
||||
uint8_t fd_header_len; /* header len from last format description event */
|
||||
uint8_t use_checksum;
|
||||
uint8_t artificial_checksun;
|
||||
uint8_t artificial_checksum;
|
||||
uint8_t verify_checksum;
|
||||
uint8_t post_header_len[ENUM_END_EVENT];
|
||||
MA_FILE *fp;
|
||||
|
@@ -698,7 +698,7 @@ MARIADB_RPL * STDCALL mariadb_rpl_init_ex(MYSQL *mysql, unsigned int version)
|
||||
MYSQL_ROW row= mysql_fetch_row(result);
|
||||
if (!strcmp(row[0], "CRC32"))
|
||||
{
|
||||
rpl->artificial_checksun= 1;
|
||||
rpl->artificial_checksum= 1;
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
@@ -1476,11 +1476,10 @@ MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVEN
|
||||
if (rpl_event->timestamp == 0 &&
|
||||
rpl_event->flags & LOG_EVENT_ARTIFICIAL_F)
|
||||
{
|
||||
if (rpl->artificial_checksun)
|
||||
if (rpl->artificial_checksum)
|
||||
{
|
||||
int4store(ev_end - 4, rpl_event->checksum);
|
||||
if (mariadb_connection(rpl->mysql))
|
||||
rpl->artificial_checksun= 0;
|
||||
unsigned long crc= crc32_z(0L, Z_NULL, 0);
|
||||
rpl_event->checksum= (uint32_t) crc32_z(crc, checksum_start, ev_end - checksum_start);
|
||||
}
|
||||
}
|
||||
RPL_CHECK_POS(ev, ev_end, len);
|
||||
|
Reference in New Issue
Block a user