1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed BUG#6027: Stored procedures can be renamed.

Removed the support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
This commit is contained in:
pem@mysql.comhem.se
2004-10-22 19:05:17 +02:00
parent cbaa07d78d
commit ebf8dc0da6
8 changed files with 29 additions and 69 deletions

View File

@@ -442,9 +442,7 @@ db_drop_routine(THD *thd, int type, sp_name *name)
static int
db_update_routine(THD *thd, int type, sp_name *name,
char *newname, uint newnamelen,
st_sp_chistics *chistics)
db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
{
TABLE *table;
int ret;
@@ -462,10 +460,6 @@ db_update_routine(THD *thd, int type, sp_name *name,
if (chistics->suid != SP_IS_DEFAULT_SUID)
table->field[MYSQL_PROC_FIELD_SECURITY_TYPE]->
store((longlong)chistics->suid);
if (newname)
table->field[MYSQL_PROC_FIELD_NAME]->store(newname,
newnamelen,
system_charset_info);
if (chistics->daccess != SP_DEFAULT_ACCESS)
table->field[MYSQL_PROC_FIELD_ACCESS]->
store((longlong)chistics->daccess);
@@ -772,9 +766,7 @@ sp_drop_procedure(THD *thd, sp_name *name)
int
sp_update_procedure(THD *thd, sp_name *name,
char *newname, uint newnamelen,
st_sp_chistics *chistics)
sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics)
{
int ret;
bool found;
@@ -782,8 +774,7 @@ sp_update_procedure(THD *thd, sp_name *name,
DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
found= sp_cache_remove(&thd->sp_proc_cache, name);
ret= db_update_routine(thd, TYPE_ENUM_PROCEDURE, name,
newname, newnamelen, chistics);
ret= db_update_routine(thd, TYPE_ENUM_PROCEDURE, name, chistics);
if (!found && !ret)
sp_cache_invalidate();
DBUG_RETURN(ret);
@@ -870,9 +861,7 @@ sp_drop_function(THD *thd, sp_name *name)
int
sp_update_function(THD *thd, sp_name *name,
char *newname, uint newnamelen,
st_sp_chistics *chistics)
sp_update_function(THD *thd, sp_name *name, st_sp_chistics *chistics)
{
int ret;
bool found;
@@ -880,8 +869,7 @@ sp_update_function(THD *thd, sp_name *name,
DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
found= sp_cache_remove(&thd->sp_func_cache, name);
ret= db_update_routine(thd, TYPE_ENUM_FUNCTION, name,
newname, newnamelen, chistics);
ret= db_update_routine(thd, TYPE_ENUM_FUNCTION, name, chistics);
if (!found && !ret)
sp_cache_invalidate();
DBUG_RETURN(ret);