From 12c862a2c27d896f94f1f778b6cce3fb6138ef9c Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Fri, 19 May 2017 10:44:23 +0200 Subject: [PATCH] MXS-1266: saving GTID, part1: SQL statements review Saving GTID: SQL statements review in blr_load_last_mariadb_gtid and blr_fetch_mariadb_gtid --- server/modules/routing/binlogrouter/blr_file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/modules/routing/binlogrouter/blr_file.c b/server/modules/routing/binlogrouter/blr_file.c index bd63532ae..acb2e1d07 100644 --- a/server/modules/routing/binlogrouter/blr_file.c +++ b/server/modules/routing/binlogrouter/blr_file.c @@ -3503,8 +3503,7 @@ bool blr_fetch_mariadb_gtid(ROUTER_SLAVE *slave, "FROM gtid_maps " "WHERE (rep_domain = %" PRIu32 " AND " "server_id = %" PRIu32 " AND " - "sequence = %" PRIu64 ") " - "LIMIT 1;"; + "sequence = %" PRIu64 ");"; ss_dassert(gtid != NULL); /* Parse GTID value into its components */ @@ -3650,8 +3649,8 @@ bool blr_load_last_mariadb_gtid(ROUTER_INSTANCE *router, " '-' || server_id ||" " '-' || sequence) AS gtid, " "binlog_file, " - "MAX(start_pos) AS start_pos, " - "MAX(end_pos) AS end_pos " + "start_pos, " + "end_pos " "FROM gtid_maps " "WHERE id = " "(SELECT MAX(id) FROM gtid_maps);";