summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 1076772d598..30e8829d764 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -135,6 +135,7 @@ void udf_init()
initialized = 1;
new_thd->thread_stack= (char*) &new_thd;
new_thd->store_globals();
+ lex_start(new_thd);
new_thd->set_db(db, sizeof(db)-1);
bzero((uchar*) &tables,sizeof(tables));
@@ -393,7 +394,12 @@ int mysql_create_function(THD *thd,udf_func *udf)
if (!initialized)
{
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+ if (opt_noacl)
+ my_error(ER_CANT_INITIALIZE_UDF, MYF(0),
+ udf->name.str,
+ "UDFs are unavailable with the --skip-grant-tables option");
+ else
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
DBUG_RETURN(1);
}
@@ -516,7 +522,10 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
if (!initialized)
{
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+ if (opt_noacl)
+ my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), udf_name->str);
+ else
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
DBUG_RETURN(1);
}