1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

After-merge fix: Actually apply the changes

The merge a8ed0f77a3
was accidentally a null-merge.

MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
This commit is contained in:
Sujatha
2020-01-08 17:09:31 +05:30
parent a8ed0f77a3
commit a0eefdf32e
8 changed files with 208 additions and 28 deletions

View File

@ -3975,6 +3975,11 @@ bool mysql_show_binlog_events(THD* thd)
List<Item> field_list;
const char *errmsg = 0;
bool ret = TRUE;
/*
Using checksum validate the correctness of event pos specified in show
binlog events command.
*/
bool verify_checksum_once= false;
IO_CACHE log;
File file = -1;
MYSQL_BIN_LOG *binary_log= NULL;
@ -4030,6 +4035,10 @@ bool mysql_show_binlog_events(THD* thd)
mi= 0;
}
/* Validate user given position using checksum */
if (lex_mi->pos == pos && !opt_master_verify_checksum)
verify_checksum_once= true;
unit->set_limit(thd->lex->current_select);
name= search_file_name;
@ -4107,15 +4116,16 @@ bool mysql_show_binlog_events(THD* thd)
for (event_count = 0;
(ev = Log_event::read_log_event(&log,
description_event,
opt_master_verify_checksum)); )
(opt_master_verify_checksum ||
verify_checksum_once))); )
{
if (!unit->lim.check_offset(event_count) &&
ev->net_send(protocol, linfo.log_file_name, pos))
ev->net_send(protocol, linfo.log_file_name, pos))
{
errmsg = "Net error";
delete ev;
errmsg = "Net error";
delete ev;
mysql_mutex_unlock(log_lock);
goto err;
goto err;
}
if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT)
@ -4141,10 +4151,11 @@ bool mysql_show_binlog_events(THD* thd)
delete ev;
}
verify_checksum_once= false;
pos = my_b_tell(&log);
if (++event_count >= unit->lim.get_select_limit())
break;
break;
}
if (unlikely(event_count < unit->lim.get_select_limit() && log.error))