Commit 3bda4d47 authored by serg@serg.mylan's avatar serg@serg.mylan

Merge bk-internal:/home/bk/mysql-5.0

into serg.mylan:/usr/home/serg/Abk/mysql-5.0
parents 1d42be4f aaad9172
...@@ -1153,7 +1153,6 @@ sp_change_db(THD *thd, char *name, bool no_access_check) ...@@ -1153,7 +1153,6 @@ sp_change_db(THD *thd, char *name, bool no_access_check)
int length, db_length; int length, db_length;
char *dbname=my_strdup((char*) name,MYF(MY_WME)); char *dbname=my_strdup((char*) name,MYF(MY_WME));
char path[FN_REFLEN]; char path[FN_REFLEN];
ulong db_access;
HA_CREATE_INFO create; HA_CREATE_INFO create;
DBUG_ENTER("sp_change_db"); DBUG_ENTER("sp_change_db");
DBUG_PRINT("enter", ("db: %s, no_access_check: %d", name, no_access_check)); DBUG_PRINT("enter", ("db: %s, no_access_check: %d", name, no_access_check));
...@@ -1174,6 +1173,8 @@ sp_change_db(THD *thd, char *name, bool no_access_check) ...@@ -1174,6 +1173,8 @@ sp_change_db(THD *thd, char *name, bool no_access_check)
#ifndef NO_EMBEDDED_ACCESS_CHECKS #ifndef NO_EMBEDDED_ACCESS_CHECKS
if (! no_access_check) if (! no_access_check)
{ {
ulong db_access;
if (test_all_bits(thd->master_access,DB_ACLS)) if (test_all_bits(thd->master_access,DB_ACLS))
db_access=DB_ACLS; db_access=DB_ACLS;
else else
......
...@@ -3339,16 +3339,15 @@ create_error: ...@@ -3339,16 +3339,15 @@ create_error:
} }
case SQLCOM_CREATE_FUNCTION: // UDF function case SQLCOM_CREATE_FUNCTION: // UDF function
{ {
sp_head *sph;
if (check_access(thd,INSERT_ACL,"mysql",0,1,0)) if (check_access(thd,INSERT_ACL,"mysql",0,1,0))
break; break;
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
if ((sph= sp_find_function(thd, lex->spname))) if (sp_find_function(thd, lex->spname))
{ {
my_error(ER_UDF_EXISTS, MYF(0), lex->spname->m_name.str); my_error(ER_UDF_EXISTS, MYF(0), lex->spname->m_name.str);
goto error; goto error;
} }
if (!(res = mysql_create_function(thd,&lex->udf))) if (!(res = mysql_create_function(thd, &lex->udf)))
send_ok(thd); send_ok(thd);
#else #else
res= TRUE; res= TRUE;
...@@ -3800,19 +3799,19 @@ create_error: ...@@ -3800,19 +3799,19 @@ create_error:
else else
sp= sp_find_function(thd, lex->spname); sp= sp_find_function(thd, lex->spname);
mysql_reset_errors(thd); mysql_reset_errors(thd);
if (! sp) if (sp)
result= SP_KEY_NOT_FOUND;
else
{ {
if (check_sp_definer_access(thd, sp)) if (check_sp_definer_access(thd, sp))
goto error; goto error;
if (lex->sql_command == SQLCOM_DROP_PROCEDURE) if (lex->sql_command == SQLCOM_DROP_PROCEDURE)
result= sp_drop_procedure(thd, lex->spname); result= sp_drop_procedure(thd, lex->spname);
else else
{
result= sp_drop_function(thd, lex->spname); result= sp_drop_function(thd, lex->spname);
}
else
{
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
if (result == SP_KEY_NOT_FOUND) if (lex->sql_command == SQLCOM_DROP_FUNCTION)
{ {
udf_func *udf = find_udf(lex->spname->m_name.str, udf_func *udf = find_udf(lex->spname->m_name.str,
lex->spname->m_name.length); lex->spname->m_name.length);
...@@ -3820,7 +3819,7 @@ create_error: ...@@ -3820,7 +3819,7 @@ create_error:
{ {
if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 0)) if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 0))
goto error; goto error;
if (!(res = mysql_drop_function(thd,&lex->spname->m_name))) if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
{ {
send_ok(thd); send_ok(thd);
break; break;
...@@ -3828,7 +3827,7 @@ create_error: ...@@ -3828,7 +3827,7 @@ create_error:
} }
} }
#endif #endif
} result= SP_KEY_NOT_FOUND;
} }
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