Removed FULL option from SHOW BINARY LOGS
If option ‘binlog_structure’ is set to ‘tree’ then SHOW BINARY LOGS displays the tree details of the binlog files. MySQL [(none)]> SHOW BINARY LOGS; +--------------------------+-----------+ | Log_name | File_size | +--------------------------+-----------+ | 0/10122/mysql-bin.000117 | 1167 | | 0/10122/mysql-bin.000118 | 652 | | 0/10124/foo-bin.000016 | 5082 | | 0/10124/foo-bin.000017 | 491 | +--------------------------+-----------+ With option set to ‘flat’ (which is the default) the output contains only names: MySQL [(none)]> SHOW BINARY LOGS; +------------------+-----------+ | Log_name | File_size | +------------------+-----------+ | mysql-bin.000110 | 425 | | mysql-bin.000111 | 10409 | | mysql-bin.000112 | 9659 | +------------------+-----------+
This commit is contained in:
parent
1f4856cdc5
commit
75b17151f3
@ -103,7 +103,6 @@ typedef struct
|
||||
int seq_no; /* Output sequence in result test */
|
||||
char *last_file; /* Last binlog file found in GTID repo */
|
||||
const char *binlogdir; /* Binlog files cache dir */
|
||||
bool extra_info; /* Add extra ouput info */
|
||||
DCB *client; /* Connected client DCB */
|
||||
bool use_tree; /* Binlog structure type */
|
||||
} BINARY_LOG_DATA_RESULT;
|
||||
@ -573,7 +572,7 @@ blr_skip_leading_sql_comments(const char *sql_query)
|
||||
* SHOW SLAVE HOSTS
|
||||
* SHOW WARNINGS
|
||||
* SHOW [GLOBAL] STATUS LIKE 'Uptime'
|
||||
* SHOW [FULL] BINARY LOGS
|
||||
* SHOW BINARY LOGS
|
||||
*
|
||||
* 12 set commands are supported:
|
||||
* SET @master_binlog_checksum = @@global.binlog_checksum
|
||||
@ -7162,9 +7161,7 @@ static bool blr_handle_show_stmt(ROUTER_INSTANCE *router,
|
||||
blr_slave_show_warnings(router, slave);
|
||||
return true;
|
||||
}
|
||||
else if (strcasecmp(word, "BINARY") == 0 ||
|
||||
(strcasecmp(word, "FULL") == 0 &&
|
||||
strcasecmp(word, "BINARY")))
|
||||
else if (strcasecmp(word, "BINARY") == 0)
|
||||
{
|
||||
if (router->mariadb10_gtid)
|
||||
{
|
||||
@ -8141,15 +8138,20 @@ blr_show_binary_logs(ROUTER_INSTANCE *router,
|
||||
"rep_domain, "
|
||||
"server_id "
|
||||
"FROM gtid_maps "
|
||||
"GROUP BY rep_domain, "
|
||||
"server_id, "
|
||||
"binlog_file "
|
||||
"ORDER BY id ASC;";
|
||||
"GROUP BY binlog_file "
|
||||
"ORDER BY id ASC;";
|
||||
static const char select_query_full[] = "SELECT binlog_file, "
|
||||
"MAX(end_pos) AS size, "
|
||||
"rep_domain, "
|
||||
"server_id "
|
||||
"FROM gtid_maps "
|
||||
"GROUP BY rep_domain, "
|
||||
"server_id, "
|
||||
"binlog_file "
|
||||
"ORDER BY id ASC;";
|
||||
int seqno;
|
||||
char *errmsg = NULL;
|
||||
BINARY_LOG_DATA_RESULT result = {};
|
||||
bool extra_info = !strcasecmp(extra_data, "FULL") &&
|
||||
router->storage_type == BLR_BINLOG_STORAGE_TREE;
|
||||
|
||||
/* Get current binlog finename and position */
|
||||
spinlock_acquire(&router->binlog_lock);
|
||||
@ -8192,7 +8194,6 @@ blr_show_binary_logs(ROUTER_INSTANCE *router,
|
||||
result.client = slave->dcb;
|
||||
result.last_file = NULL;
|
||||
result.binlogdir = router->binlogdir;
|
||||
result.extra_info = extra_info;
|
||||
result.use_tree = router->storage_type == BLR_BINLOG_STORAGE_TREE;
|
||||
|
||||
/**
|
||||
@ -8205,7 +8206,9 @@ blr_show_binary_logs(ROUTER_INSTANCE *router,
|
||||
* - result.seq_no is increased
|
||||
*/
|
||||
if (sqlite3_exec(router->gtid_maps,
|
||||
select_query,
|
||||
!result.use_tree ?
|
||||
select_query :
|
||||
select_query_full,
|
||||
binary_logs_select_cb,
|
||||
&result,
|
||||
&errmsg) != SQLITE_OK)
|
||||
@ -8242,7 +8245,7 @@ blr_show_binary_logs(ROUTER_INSTANCE *router,
|
||||
|
||||
char *filename;
|
||||
char last_filename[BINLOG_FILE_EXTRA_INFO + strlen(current_file) + 1];
|
||||
if (extra_info)
|
||||
if (result.use_tree)
|
||||
{
|
||||
char t_prefix[BINLOG_FILE_EXTRA_INFO];
|
||||
sprintf(t_prefix,
|
||||
@ -8385,7 +8388,7 @@ static int binary_logs_select_cb(void *data,
|
||||
sprintf(file_size, "%" PRIu32 "", fsize);
|
||||
|
||||
// Include prefix in the output
|
||||
if (data_set->extra_info)
|
||||
if (data_set->use_tree)
|
||||
{
|
||||
sprintf(filename,
|
||||
"%s%s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user