summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result7
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test12
-rw-r--r--sql/sql_repl.cc4
3 files changed, 14 insertions, 9 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
index d6a826ffaaa..7f27f2bdeee 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
@@ -17,6 +17,10 @@ a b
1 1
2 1
include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
+master_user = 'root', master_use_gtid = current_pos;
+START SLAVE;
+include/wait_for_slave_to_start.inc
INSERT INTO t1 VALUES (3, 2);
INSERT INTO t1 VALUES (4, 2);
show binlog events from <binlog_start>;
@@ -27,9 +31,6 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, 2)
slave-bin.000001 # Query # # COMMIT
-CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
-master_user = 'root', master_use_gtid = current_pos;
-START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b
1 1
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
index ceb79062155..1e33520efb5 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
@@ -22,16 +22,20 @@ SELECT * FROM t1 ORDER BY a;
--source include/stop_slave.inc
+--connection server_1
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
+ master_user = 'root', master_use_gtid = current_pos;
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+--connection server_2
INSERT INTO t1 VALUES (3, 2);
INSERT INTO t1 VALUES (4, 2);
--source include/show_binlog_events.inc
--connection server_1
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
- master_user = 'root', master_use_gtid = current_pos;
-START SLAVE;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
--source include/wait_condition.inc
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index fcda6452e92..21634ac6dfc 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1042,8 +1042,8 @@ check_slave_start_position(THD *thd, slave_connection_state *st,
*/
if (!delete_list)
{
- if ((delete_list= (rpl_gtid **)my_malloc(sizeof(*delete_list),
- MYF(MY_WME))))
+ if (!(delete_list= (rpl_gtid **)
+ my_malloc(sizeof(*delete_list) * st->hash.records, MYF(MY_WME))))
{
*errormsg= "Out of memory while checking slave start position";
err= ER_OUT_OF_RESOURCES;