Commit e0e281ec authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

Fixed BUG#6663: Stored Procedures code report non-selected DB

                when CREATE but not when ALTER
parent 3b1c3d8c
...@@ -4128,7 +4128,15 @@ unsent_create_error: ...@@ -4128,7 +4128,15 @@ unsent_create_error:
sp= sp_find_function(thd, lex->spname); sp= sp_find_function(thd, lex->spname);
mysql_reset_errors(thd, 0); mysql_reset_errors(thd, 0);
if (! sp) if (! sp)
result= SP_KEY_NOT_FOUND; {
if (lex->spname->m_db.str)
result= SP_KEY_NOT_FOUND;
else
{
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
goto error;
}
}
else else
{ {
if (check_procedure_access(thd, ALTER_PROC_ACL, sp->m_db.str, if (check_procedure_access(thd, ALTER_PROC_ACL, sp->m_db.str,
...@@ -4207,7 +4215,13 @@ unsent_create_error: ...@@ -4207,7 +4215,13 @@ unsent_create_error:
} }
} }
#endif #endif
result= SP_KEY_NOT_FOUND; if (lex->spname->m_db.str)
result= SP_KEY_NOT_FOUND;
else
{
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
goto error;
}
} }
res= result; res= result;
switch (result) switch (result)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment