Rename conflicting objects

The START_ENCRYPTION_EVENT is the name of an object that is exposed by the
Connector-C.
This commit is contained in:
Markus Mäkelä 2018-06-07 16:02:42 +03:00
parent 5268d032c5
commit d094e93209
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
3 changed files with 15 additions and 15 deletions

View File

@ -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;
}

View File

@ -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<BINLOG_ENCRYPTION_CTX*>(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<BINLOG_ENCRYPTION_CTX*>(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

View File

@ -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;