From 25038432bb203a4abb36e2bdc672a7f23012c0ff Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 24 Sep 2018 15:35:20 +0300 Subject: [PATCH] MXS-2047 Rename MARIADB_GTID_INFO::file -> binlog_name That's how the concept is named elsewhere. --- server/modules/routing/binlogrouter/blr.hh | 2 +- .../modules/routing/binlogrouter/blr_file.cc | 34 +++++++++---------- .../modules/routing/binlogrouter/blr_slave.cc | 8 ++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/server/modules/routing/binlogrouter/blr.hh b/server/modules/routing/binlogrouter/blr.hh index a31e4f9ab..925a8e71c 100644 --- a/server/modules/routing/binlogrouter/blr.hh +++ b/server/modules/routing/binlogrouter/blr.hh @@ -341,7 +341,7 @@ typedef struct mariadb_gtid_elems typedef struct mariadb_gtid_info { char gtid[GTID_MAX_LEN + 1]; /** MariaDB 10.x GTID, string value */ - char file[BINLOG_FNAMELEN + 1]; /** The binlog file */ + char binlog_name[BINLOG_FNAMELEN + 1]; /** The binlog file */ uint64_t start; /** The BEGIN pos: i.e the GTID event */ uint64_t end; /** The next_pos in COMMIT event */ MARIADB_GTID_ELEMS gtid_elms; /** MariaDB 10.x GTID components */ diff --git a/server/modules/routing/binlogrouter/blr_file.cc b/server/modules/routing/binlogrouter/blr_file.cc index 43c971fda..6dd79bb73 100644 --- a/server/modules/routing/binlogrouter/blr_file.cc +++ b/server/modules/routing/binlogrouter/blr_file.cc @@ -413,15 +413,15 @@ int blr_file_init(ROUTER_INSTANCE* router) "%s/%s/%s", path, f_prefix, - last_gtid.file); + last_gtid.binlog_name); if (access(filename, R_OK) != -1) { - blr_file_append(router, last_gtid.file); + blr_file_append(router, last_gtid.binlog_name); ret = 1; } else { - ret = blr_file_create(router, last_gtid.file); + ret = blr_file_create(router, last_gtid.binlog_name); } return ret; @@ -1707,7 +1707,7 @@ int blr_file_next_exists(ROUTER_INSTANCE* router, } // Check whether the query has a result - if (result.file[0]) + if (result.binlog_name[0]) { // Full filename path sprintf(bigbuf, @@ -1715,9 +1715,9 @@ int blr_file_next_exists(ROUTER_INSTANCE* router, router->binlogdir, result.gtid_elms.domain_id, result.gtid_elms.server_id, - result.file); + result.binlog_name); // Set the new file name in the output - memcpy(next_file, result.file, BINLOG_FNAMELEN); + memcpy(next_file, result.binlog_name, BINLOG_FNAMELEN); next_file[BINLOG_FNAMELEN] = '\0'; MXS_DEBUG("The next Binlog file from GTID maps repo is [%s]", @@ -1730,7 +1730,7 @@ int blr_file_next_exists(ROUTER_INSTANCE* router, * file and domain_id / server_id * Note: slave->binlog_name is untouched */ - strcpy(slave->f_info.file, result.file); + strcpy(slave->f_info.binlog_name, result.binlog_name); slave->f_info.gtid_elms.domain_id = result.gtid_elms.domain_id; slave->f_info.gtid_elms.server_id = result.gtid_elms.server_id; @@ -2725,7 +2725,7 @@ int blr_read_events_all_events(ROUTER_INSTANCE* router, " in GTID maps repo was (%s). File %s%s", mariadb_gtid, f_prefix, - gtid_info.file); + gtid_info.binlog_name); } } } @@ -4340,7 +4340,7 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE* inst) MARIADB_GTID_ELEMS gtid_elms; strcpy(gtid_info.gtid, inst->pending_transaction.gtid); - strcpy(gtid_info.file, inst->binlog_name); + strcpy(gtid_info.binlog_name, inst->binlog_name); gtid_info.start = inst->pending_transaction.start_pos; gtid_info.end = inst->pending_transaction.end_pos; memcpy(>id_elms, @@ -4354,7 +4354,7 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE* inst) gtid_elms.domain_id, gtid_elms.server_id, gtid_elms.seq_no, - gtid_info.file, + gtid_info.binlog_name, gtid_info.start, gtid_info.end); @@ -4377,7 +4377,7 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE* inst) gtid_elms.domain_id, gtid_elms.server_id, gtid_elms.seq_no, - gtid_info.file); + gtid_info.binlog_name); /* Update GTID into repo */ if ((sql_ret = sqlite3_exec(inst->gtid_maps, @@ -4390,7 +4390,7 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE* inst) "into gtid_maps database: %s", inst->service->name, gtid_info.gtid, - gtid_info.file, + gtid_info.binlog_name, gtid_info.start, gtid_info.end, errmsg); @@ -4406,7 +4406,7 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE* inst) "into gtid_maps database: %s", inst->service->name, gtid_info.gtid, - gtid_info.file, + gtid_info.binlog_name, gtid_info.start, gtid_info.end, errmsg); @@ -4452,7 +4452,7 @@ static int gtid_select_cb(void* data, && values[3]) { strcpy(result->gtid, values[0]); - strcpy(result->file, values[1]); + strcpy(result->binlog_name, values[1]); result->start = atoll(values[2]); result->end = atoll(values[3]); @@ -4554,7 +4554,7 @@ bool blr_fetch_mariadb_gtid(ROUTER_SLAVE* slave, MXS_INFO("Binlog file to read from is %" PRIu32 "/%" PRIu32 "/%s", result->gtid_elms.domain_id, result->gtid_elms.server_id, - result->file); + result->binlog_name); } } return result->gtid[0] ? true : false; @@ -4725,7 +4725,7 @@ static int gtid_file_select_cb(void* data, && values[2] && values[3]) { - strcpy(result->file, values[3]); + strcpy(result->binlog_name, values[3]); result->gtid_elms.domain_id = atoll(values[1]); result->gtid_elms.server_id = atoll(values[2]); } @@ -4873,7 +4873,7 @@ bool blr_binlog_file_exists(ROUTER_INSTANCE* router, strcat(path, info_file == NULL ? router->binlog_name : - info_file->file); + info_file->binlog_name); // Check file if (access(path, F_OK) == -1 && errno == ENOENT) diff --git a/server/modules/routing/binlogrouter/blr_slave.cc b/server/modules/routing/binlogrouter/blr_slave.cc index 7dd7e64dd..8e1410dfe 100644 --- a/server/modules/routing/binlogrouter/blr_slave.cc +++ b/server/modules/routing/binlogrouter/blr_slave.cc @@ -7190,7 +7190,7 @@ static bool blr_slave_gtid_request(ROUTER_INSTANCE* router, slave->serverid, f_gtid.gtid_elms.domain_id, f_gtid.gtid_elms.server_id, - f_gtid.file, + f_gtid.binlog_name, f_gtid.start, f_gtid.end); @@ -7202,10 +7202,10 @@ static bool blr_slave_gtid_request(ROUTER_INSTANCE* router, * if the requested binlog file is equal to GTID info file use it. */ if (!req_file - || (strcmp(slave->binlog_name, f_gtid.file) == 0)) + || (strcmp(slave->binlog_name, f_gtid.binlog_name) == 0)) { /* Set binlog file to the GTID one */ - strcpy(slave->binlog_name, f_gtid.file); + strcpy(slave->binlog_name, f_gtid.binlog_name); /* Set pos to GTID next event pos */ slave->binlog_pos = f_gtid.end; @@ -7245,7 +7245,7 @@ static bool blr_slave_gtid_request(ROUTER_INSTANCE* router, else { /* Set binlog file to the GTID one */ - strcpy(slave->binlog_name, f_gtid.file); + strcpy(slave->binlog_name, f_gtid.binlog_name); /* Set pos to GTID next event pos */ slave->binlog_pos = f_gtid.end;