1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-29 00:08:14 +03:00

A fix and a test case for Bug#17843 "Certain stored procedures fail to

run at startup"

The server returned an error when trying to execute init-file with a 
stored procedure that could return multiple result sets to the client. 
A stored procedure can return multiple result sets if it contains 
PREPARE, SELECT, SHOW and similar statements.
   
The fix is to set client_capabilites|=CLIENT_MULTI_RESULTS in
sql_parse.cc:handle_bootstrap(). There is no "client" really, so 
nothing is ever sent. This makes init-file feature behave consistently: 
the prepared statements that can be called directly in the init-file 
can be used in a stored procedure too.

Re-committed the patch originally submitted by Per-Erik after review.
This commit is contained in:
konstantin@mysql.com
2006-07-04 23:46:15 +04:00
parent e87278f468
commit b99e11c8bd
8 changed files with 383 additions and 8 deletions

View File

@@ -1250,6 +1250,12 @@ pthread_handler_t handle_bootstrap(void *arg)
thd->version=refresh_version;
thd->security_ctx->priv_user=
thd->security_ctx->user= (char*) my_strdup("boot", MYF(MY_WME));
/*
Make the "client" handle multiple results. This is necessary
to enable stored procedures with SELECTs and Dynamic SQL
in init-file.
*/
thd->client_capabilities|= CLIENT_MULTI_RESULTS;
buff= (char*) thd->net.buff;
thd->init_for_queries();