diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2004-03-19 14:36:12 +0400 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2004-03-19 14:36:12 +0400 |
commit | d212d76094f83b1b7ce0692663439f3a67a432ad (patch) | |
tree | 41c48cabb81bc450c437b8ad08f9c98e8b335280 | |
parent | 54735ae3a9252fa64c38f930b516e60d394e65cb (diff) | |
parent | 433c2bf535ff190933d7a7463c56bfef878b3cd2 (diff) | |
download | mariadb-git-d212d76094f83b1b7ce0692663439f3a67a432ad.tar.gz |
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.1
into gluh.mysql.r18.ru:/home/gluh/mysql-4.1.clear
-rw-r--r-- | sql/item_func.cc | 4 | ||||
-rw-r--r-- | sql/sql_udf.cc | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 04e3452c1f7..f24891dfa6b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1489,11 +1489,11 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func, arg++,i++) { if ((*arg)->fix_fields(thd, tables, arg)) - return 1; + DBUG_RETURN(1); // we can't assign 'item' before, because fix_fields() can change arg Item *item= *arg; if (item->check_cols(1)) - return 1; + DBUG_RETURN(1); /* TODO: We should think about this. It is not always right way just to set an UDF result to return my_charset_bin diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index a4461beed29..561f79f9de1 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -298,7 +298,11 @@ udf_func *find_udf(const char *name,uint length,bool mark_used) DBUG_ENTER("find_udf"); /* TODO: This should be changed to reader locks someday! */ - rw_rdlock(&THR_LOCK_udf); + if (mark_used) + rw_wrlock(&THR_LOCK_udf); /* Called during fix_fields */ + else + rw_rdlock(&THR_LOCK_udf); /* Called during parsing */ + if ((udf=(udf_func*) hash_search(&udf_hash,(byte*) name, length ? length : (uint) strlen(name)))) { @@ -474,7 +478,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name->str, (uint) udf_name->length))) { - net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name); + net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name->str); goto err; } del_udf(udf); |