From d094e9320922c96413e568f605832eb5a91299cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Jun 2018 16:02:42 +0300 Subject: [PATCH] Rename conflicting objects The START_ENCRYPTION_EVENT is the name of an object that is exposed by the Connector-C. --- server/modules/routing/binlogrouter/blr.cc | 6 +++--- server/modules/routing/binlogrouter/blr_file.cc | 12 ++++++------ server/modules/routing/binlogrouter/blr_slave.cc | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/server/modules/routing/binlogrouter/blr.cc b/server/modules/routing/binlogrouter/blr.cc index c122b90ae..6d94195ad 100644 --- a/server/modules/routing/binlogrouter/blr.cc +++ b/server/modules/routing/binlogrouter/blr.cc @@ -1111,12 +1111,12 @@ createInstance(SERVICE *service, char **options) } /** - * Don't start replication if binlog has START_ENCRYPTION_EVENT + * Don't start replication if binlog has MXS_START_ENCRYPTION_EVENT * but binlog encryption is off */ if (!inst->encryption.enabled && inst->encryption_ctx) { - MXS_ERROR("Found START_ENCRYPTION_EVENT but " + MXS_ERROR("Found MXS_START_ENCRYPTION_EVENT but " "binlog encryption option is currently Off. Replication can't start right now. " "Please restart MaxScale with option set to On"); @@ -1126,7 +1126,7 @@ createInstance(SERVICE *service, char **options) inst->m_errno = BINLOG_FATAL_ERROR_READING; inst->m_errmsg = MXS_STRDUP_A("HY000 Binlog encryption is Off" " but current binlog file has" - " the START_ENCRYPTION_EVENT"); + " the MXS_START_ENCRYPTION_EVENT"); return (MXS_ROUTER *)inst; } diff --git a/server/modules/routing/binlogrouter/blr_file.cc b/server/modules/routing/binlogrouter/blr_file.cc index 0885f89a7..d349019c9 100644 --- a/server/modules/routing/binlogrouter/blr_file.cc +++ b/server/modules/routing/binlogrouter/blr_file.cc @@ -225,7 +225,7 @@ typedef struct start_encryption_event uint8_t nonce[BLRM_NONCE_LENGTH]; /**< nonce (random bytes) of current binlog. * These bytes + the binlog event current pos * form the encrryption IV for the event */ -} START_ENCRYPTION_EVENT; +} MXS_START_ENCRYPTION_EVENT; /** * Initialise the binlog file for this instance. MaxScale will look @@ -766,7 +766,7 @@ blr_write_binlog_record(ROUTER_INSTANCE *router, /* Check whether adding the Start Encryption event into current binlog */ if (router->encryption.enabled && write_start_encryption_event) { - uint64_t event_size = sizeof(START_ENCRYPTION_EVENT); + uint64_t event_size = sizeof(MXS_START_ENCRYPTION_EVENT); uint64_t file_offset = router->current_pos; if (router->master_chksum) { @@ -2391,7 +2391,7 @@ blr_read_events_all_events(ROUTER_INSTANCE *router, if (hdr.event_type == MARIADB10_START_ENCRYPTION_EVENT) { char nonce_hex[AES_BLOCK_SIZE * 2 + 1] = ""; - START_ENCRYPTION_EVENT ste_event = {}; + MXS_START_ENCRYPTION_EVENT ste_event = {}; void *mem = MXS_CALLOC(1, sizeof(BINLOG_ENCRYPTION_CTX)); BINLOG_ENCRYPTION_CTX *new_encryption_ctx = static_cast(mem); @@ -3460,7 +3460,7 @@ blr_write_special_event(ROUTER_INSTANCE *router, return 1; } -/** Create the START_ENCRYPTION_EVENT +/** Create the MXS_START_ENCRYPTION_EVENT * * This is a New Event added in MariaDB 10.1.7 * Type is 0xa4 and size 36 (crc32 not included) @@ -3477,7 +3477,7 @@ blr_create_start_encryption_event(ROUTER_INSTANCE *router, bool do_checksum) { uint8_t *new_event; - uint8_t event_size = sizeof(START_ENCRYPTION_EVENT); + uint8_t event_size = sizeof(MXS_START_ENCRYPTION_EVENT); BINLOG_ENCRYPTION_CTX *new_encryption_ctx = static_cast(MXS_CALLOC(1, sizeof(BINLOG_ENCRYPTION_CTX))); @@ -3683,7 +3683,7 @@ static GWBUF *blr_aes_crypt(ROUTER_INSTANCE *router, * @buf The binlog event * @size The event size (CRC32 four bytes included) * @pos The position of the event in binlog file - * @nonce The binlog nonce 12 bytes as in START_ENCRYPTION_EVENT + * @nonce The binlog nonce 12 bytes as in MXS_START_ENCRYPTION_EVENT * of requested or current binlog file * If nonce is NULL the one from current binlog file is used. * @action Encryption action: 1 Encryp, 0 Decryot diff --git a/server/modules/routing/binlogrouter/blr_slave.cc b/server/modules/routing/binlogrouter/blr_slave.cc index f21dfc273..803c5b514 100644 --- a/server/modules/routing/binlogrouter/blr_slave.cc +++ b/server/modules/routing/binlogrouter/blr_slave.cc @@ -2121,7 +2121,7 @@ blr_slave_binlog_dump(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue slave->lastEventReceived = FORMAT_DESCRIPTION_EVENT; /** - * Check for START_ENCRYPTION_EVENT (after FDE) if + * Check for MXS_START_ENCRYPTION_EVENT (after FDE) if * client request pos is greater than 4 * * TODO: If router has binlog encryption take it @@ -2423,7 +2423,7 @@ blr_slave_catchup(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, bool large) /* In case of file rotation or pos = 4 the events * are sent from position 4 and the new FDE at pos 4 is read. * We need to check whether the first event after FDE - * is the MARIADB10_START_ENCRYPTION_EVENT of the new file. + * is the MARIADB10_MXS_START_ENCRYPTION_EVENT of the new file. * * Read it if slave->encryption_ctx is NULL and * set the slave->encryption_ctx accordingly @@ -6377,11 +6377,11 @@ bool blr_notify_waiting_slave(ROUTER_SLAVE *slave) } /** - * Read START_ENCRYPTION_EVENT, after FDE + * Read MXS_START_ENCRYPTION_EVENT, after FDE * * @param router The router instance * @param slave The connected slave server - * @param fde_end_pos The position of START_ENCRYPTION_EVENT, after FDE + * @param fde_end_pos The position of MXS_START_ENCRYPTION_EVENT, after FDE * @return Non zero on success */ static int @@ -6434,7 +6434,7 @@ blr_slave_read_ste(ROUTER_INSTANCE *router, blr_close_binlog(router, file); - /* check for START_ENCRYPTION_EVENT */ + /* check for MXS_START_ENCRYPTION_EVENT */ if (hdr.event_type == MARIADB10_START_ENCRYPTION_EVENT) { uint8_t *record_ptr = GWBUF_DATA(record); @@ -6477,7 +6477,7 @@ blr_slave_read_ste(ROUTER_INSTANCE *router, slave->binlogfile, (unsigned long)fde_end_pos + hdr.event_size); /** - * Note: if the requested pos is equal to START_ENCRYPTION_EVENT pos + * Note: if the requested pos is equal to MXS_START_ENCRYPTION_EVENT pos * the event will be skipped by blr_read_binlog() routine */ return 1;