1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-5273 Prepared statement doesn't return metadata after prepare.

SHOW MASTER STATUS fixed.
This commit is contained in:
Alexey Botchkov
2016-01-27 13:42:53 +04:00
parent 75a1d866dd
commit efb36ac5d5
4 changed files with 58 additions and 14 deletions

View File

@ -4088,6 +4088,25 @@ err:
}
void show_binlog_info_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, "File", FN_REFLEN),
mem_root);
field_list->push_back(new (mem_root)
Item_return_int(thd, "Position", 20,
MYSQL_TYPE_LONGLONG),
mem_root);
field_list->push_back(new (mem_root)
Item_empty_string(thd, "Binlog_Do_DB", 255),
mem_root);
field_list->push_back(new (mem_root)
Item_empty_string(thd, "Binlog_Ignore_DB", 255),
mem_root);
}
/**
Execute a SHOW MASTER STATUS statement.
@ -4100,23 +4119,10 @@ err:
bool show_binlog_info(THD* thd)
{
Protocol *protocol= thd->protocol;
MEM_ROOT *mem_root= thd->mem_root;
DBUG_ENTER("show_binlog_info");
List<Item> field_list;
field_list.push_back(new (mem_root)
Item_empty_string(thd, "File", FN_REFLEN),
mem_root);
field_list.push_back(new (mem_root)
Item_return_int(thd, "Position", 20,
MYSQL_TYPE_LONGLONG),
mem_root);
field_list.push_back(new (mem_root)
Item_empty_string(thd, "Binlog_Do_DB", 255),
mem_root);
field_list.push_back(new (mem_root)
Item_empty_string(thd, "Binlog_Ignore_DB", 255),
mem_root);
show_binlog_info_get_fields(thd, &field_list);
if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))