1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-4708: GTID strict mode doesn't work on a database with purged binlogs

When a new master is provisioned that does not have any old binlogs,
the @@gtid_slave_pos is used to know where in the GTID history the
provisioning happened. A slave is allowed to connect at the point of
this value of @@gtid_slave_pos, even if that GTID is not in the
binlogs on the new master.

The code to handle this case when the binlog on the newly provisioned
master is completely empty was just wrong (couple of typos). Clearly it
had never been tested ... :-/
This commit is contained in:
unknown
2013-07-10 12:01:52 +02:00
parent 1e43277838
commit 2f6a2494a5
3 changed files with 14 additions and 9 deletions

View File

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