mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-5273 Prepared statement doesn't return metadata after prepare.
SHOW BINARY LOGS fixed.
This commit is contained in:
@ -4146,6 +4146,19 @@ bool show_binlog_info(THD* thd)
|
||||
}
|
||||
|
||||
|
||||
void show_binlogs_get_fields(THD *thd, List<Item> *field_list)
|
||||
{
|
||||
MEM_ROOT *mem_root= thd->mem_root;
|
||||
field_list->push_back(new (mem_root)
|
||||
Item_empty_string(thd, "Log_name", 255),
|
||||
mem_root);
|
||||
field_list->push_back(new (mem_root)
|
||||
Item_return_int(thd, "File_size", 20,
|
||||
MYSQL_TYPE_LONGLONG),
|
||||
mem_root);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a SHOW BINARY LOGS statement.
|
||||
|
||||
@ -4165,7 +4178,6 @@ bool show_binlogs(THD* thd)
|
||||
uint length;
|
||||
int cur_dir_len;
|
||||
Protocol *protocol= thd->protocol;
|
||||
MEM_ROOT *mem_root= thd->mem_root;
|
||||
DBUG_ENTER("show_binlogs");
|
||||
|
||||
if (!mysql_bin_log.is_open())
|
||||
@ -4174,13 +4186,8 @@ bool show_binlogs(THD* thd)
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
field_list.push_back(new (mem_root)
|
||||
Item_empty_string(thd, "Log_name", 255),
|
||||
mem_root);
|
||||
field_list.push_back(new (mem_root)
|
||||
Item_return_int(thd, "File_size", 20,
|
||||
MYSQL_TYPE_LONGLONG),
|
||||
mem_root);
|
||||
show_binlogs_get_fields(thd, &field_list);
|
||||
|
||||
if (protocol->send_result_set_metadata(&field_list,
|
||||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
Reference in New Issue
Block a user