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 SLAVE STATUS fixed.
This commit is contained in:
@ -104,6 +104,7 @@ When one supplies long data for a placeholder:
|
||||
// mysql_handle_derived
|
||||
#include "sql_cursor.h"
|
||||
#include "sql_show.h"
|
||||
#include "slave.h"
|
||||
#include "sp_head.h"
|
||||
#include "sp.h"
|
||||
#include "sp_cache.h"
|
||||
@ -1892,6 +1893,29 @@ static bool mysql_test_show_grants(Prepared_statement *stmt)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Validate and prepare for execution SHOW SLAVE STATUS statement.
|
||||
|
||||
@param stmt prepared statement
|
||||
|
||||
@retval
|
||||
FALSE success
|
||||
@retval
|
||||
TRUE error, error message is set in THD
|
||||
*/
|
||||
|
||||
static bool mysql_test_show_slave_status(Prepared_statement *stmt)
|
||||
{
|
||||
DBUG_ENTER("mysql_test_show_slave_status");
|
||||
THD *thd= stmt->thd;
|
||||
List<Item> fields;
|
||||
|
||||
show_master_info_get_fields(thd, &fields, 0, 0);
|
||||
|
||||
DBUG_RETURN(send_stmt_metadata(thd, stmt, &fields));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@brief Validate and prepare for execution CREATE VIEW statement
|
||||
|
||||
@ -2246,6 +2270,13 @@ static bool check_prepared_statement(Prepared_statement *stmt)
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
break;
|
||||
case SQLCOM_SHOW_SLAVE_STAT:
|
||||
if (!(res= mysql_test_show_slave_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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user