1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-34705: Binlog-in-engine: Implement legacy SHOW MASTER STATUS

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2025-03-01 18:20:25 +01:00
parent 47e9e084a8
commit 980a8e6c42
7 changed files with 54 additions and 6 deletions

View File

@@ -5154,13 +5154,27 @@ bool show_binlog_info(THD* thd)
if (mysql_bin_log.is_open())
{
LOG_INFO li;
mysql_bin_log.get_current_log(&li);
size_t dir_len = dirname_length(li.log_file_name);
const char *base= li.log_file_name + dir_len;
const char *base;
ulonglong pos;
if (opt_binlog_engine_hton)
{
char buf[FN_REFLEN];
mysql_mutex_lock(mysql_bin_log.get_log_lock());
(*opt_binlog_engine_hton->binlog_status)(buf, &pos);
mysql_mutex_unlock(mysql_bin_log.get_log_lock());
base= buf;
}
else
{
LOG_INFO li;
mysql_bin_log.get_current_log(&li);
pos= (ulonglong) li.pos;
size_t dir_len = dirname_length(li.log_file_name);
base= li.log_file_name + dir_len;
}
protocol->store(base, strlen(base), &my_charset_bin);
protocol->store((ulonglong) li.pos);
protocol->store(pos);
protocol->store(binlog_filter->get_do_db());
protocol->store(binlog_filter->get_ignore_db());
if (protocol->write())