Skip to content

Commit 06f50fb

Browse files
committed
Bug#30566518 - SLAVE STOPS WITH INTERMITTENT ERROR 1396: ERROR
'OPERATION DROP USER FAILED FOR Post-push fix: Initialize the buffer used in MYSQL_BIN_LOG::handle_binlog_flush_or_sync_error with zeros. Reviewed by: Pedro Figueiredo <pedro.figueiredo@oracle.com>
1 parent 8eca79f commit 06f50fb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sql/binlog.cc

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License, version 2.0,
@@ -9418,17 +9418,14 @@ void MYSQL_BIN_LOG::handle_binlog_flush_or_sync_error(THD *thd,
94189418
bool need_lock_log,
94199419
const char* message)
94209420
{
9421-
char errmsg[MYSQL_ERRMSG_SIZE];
9421+
char errmsg[MYSQL_ERRMSG_SIZE]= {0};
94229422
if (!message)
94239423
sprintf(errmsg, "An error occurred during %s stage of the commit. "
94249424
"'binlog_error_action' is set to '%s'.",
94259425
thd->commit_error== THD::CE_FLUSH_ERROR ? "flush" : "sync",
94269426
binlog_error_action == ABORT_SERVER ? "ABORT_SERVER" : "IGNORE_ERROR");
94279427
else
9428-
{
94299428
strncpy(errmsg, message, MYSQL_ERRMSG_SIZE-1);
9430-
errmsg[MYSQL_ERRMSG_SIZE - 1] = '\0';
9431-
}
94329429
if (binlog_error_action == ABORT_SERVER)
94339430
{
94349431
char err_buff[MYSQL_ERRMSG_SIZE + 27];

0 commit comments

Comments
 (0)