summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2005-04-27 16:35:49 +0200
committerunknown <pem@mysql.comhem.se>2005-04-27 16:35:49 +0200
commit5c44e1acfeebe5e49b32add9a4a19aaf33892455 (patch)
tree5959438e6d5f2b1065dacbc28ea4beb9bca2bc9b /sql/item_func.cc
parent52cb1bc4ff95c76f4327f6158522b293b831ca34 (diff)
downloadmariadb-git-5c44e1acfeebe5e49b32add9a4a19aaf33892455.tar.gz
Post-review fixes of the patch for BUG#8408: Stored procedure crash if function contains SHOW
(Review on irc by monty) mysql-test/r/sp-error.result: Renamed a procedure and function to avoid confusion mysql-test/t/sp-error.test: Renamed a procedure and function to avoid confusion sql/item_func.cc: Corrected (and better) way to set/reset the client cap. flag in Item_func_sp::execute() sql/share/errmsg.txt: Changed the ER_SP_BADSELECT error; more accurate, and includes the procedure name. sql/sql_parse.cc: Include the procedure name in the new error message.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 3472c0ab786..24a3f7927ae 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4554,7 +4554,7 @@ Item_func_sp::execute(Item **itp)
{
DBUG_ENTER("Item_func_sp::execute");
THD *thd= current_thd;
- bool clcap_mr;
+ ulong old_client_capabilites;
int res;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
st_sp_security_context save_ctx;
@@ -4568,7 +4568,7 @@ Item_func_sp::execute(Item **itp)
DBUG_RETURN(-1);
}
- clcap_mr= (thd->client_capabilities & CLIENT_MULTI_RESULTS);
+ old_client_capabilites= thd->client_capabilities;
thd->client_capabilities &= ~CLIENT_MULTI_RESULTS;
#ifndef EMBEDDED_LIBRARY
@@ -4586,8 +4586,7 @@ Item_func_sp::execute(Item **itp)
m_sp->m_db.str, m_sp->m_name.str, 0))
{
sp_restore_security_context(thd, m_sp, &save_ctx);
- if (clcap_mr)
- thd->client_capabilities |= CLIENT_MULTI_RESULTS;
+ thd->client_capabilities|= old_client_capabilites & CLIENT_MULTI_RESULTS;
DBUG_RETURN(-1);
}
#endif
@@ -4602,8 +4601,7 @@ Item_func_sp::execute(Item **itp)
thd->net.no_send_ok= nsok;
#endif
- if (clcap_mr)
- thd->client_capabilities |= CLIENT_MULTI_RESULTS;
+ thd->client_capabilities|= old_client_capabilites & CLIENT_MULTI_RESULTS;
DBUG_RETURN(res);
}