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
commit efb36ac5d5
4 changed files with 58 additions and 14 deletions

View file

@ -1916,6 +1916,29 @@ static bool mysql_test_show_slave_status(Prepared_statement *stmt)
}
/**
Validate and prepare for execution SHOW MASTER STATUS statement.
@param stmt prepared statement
@retval
FALSE success
@retval
TRUE error, error message is set in THD
*/
static bool mysql_test_show_master_status(Prepared_statement *stmt)
{
DBUG_ENTER("mysql_test_show_master_status");
THD *thd= stmt->thd;
List<Item> fields;
show_binlog_info_get_fields(thd, &fields);
DBUG_RETURN(send_stmt_metadata(thd, stmt, &fields));
}
/**
@brief Validate and prepare for execution CREATE VIEW statement
@ -2277,6 +2300,13 @@ static bool check_prepared_statement(Prepared_statement *stmt)
DBUG_RETURN(FALSE);
}
break;
case SQLCOM_SHOW_MASTER_STAT:
if (!(res= mysql_test_show_master_status(stmt)))
{
/* Statement and field info has already been sent */
DBUG_RETURN(FALSE);
}
break;
case SQLCOM_CREATE_VIEW:
if (lex->create_view_mode == VIEW_ALTER)
{