summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2016-01-27 13:42:53 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2016-01-28 11:12:03 +0400
commitefb36ac5d5a5e2b7937545e2d3fddb1b7c8b7f9a (patch)
treeec8e821ca35531d4f828e3627de271cd90530283 /sql/sql_prepare.cc
parent75a1d866dd4c00b91ca9b29593ad41543f084544 (diff)
downloadmariadb-git-efb36ac5d5a5e2b7937545e2d3fddb1b7c8b7f9a.tar.gz
MDEV-5273 Prepared statement doesn't return metadata after prepare.
SHOW MASTER STATUS fixed.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index fee364912c0..7ba269ed131 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1917,6 +1917,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
@param stmt prepared 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)
{