summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-03-21 10:54:26 +0100
committerunknown <msvensson@neptunus.(none)>2006-03-21 10:54:26 +0100
commitae7974b112f668f749951a6e6825951e6a01ded8 (patch)
tree9ab08d577a0241130d460fe61c9e0550cf8bc163 /sql/sql_udf.cc
parentb16a2fef983d21b0839bc74d2e5a079e872f2fe7 (diff)
downloadmariadb-git-ae7974b112f668f749951a6e6825951e6a01ded8.tar.gz
Bug#11835 CREATE FUNCTION crashes server
- Update for 5.1 - Add "have_dlopen" - Remove requirement to load udf's only in "opt_plugin_dir" include/my_global.h: Remove duplicate defines mysql-test/include/have_udf.inc: Use "have_dlopen" to check if we "have udf" mysql-test/r/have_udf.require: Use "have_dlopen" to check if we "have udf" mysql-test/r/udf.result: Update for new error message "function"->"symbol" sql/item_func.cc: Remove "evil" dbug printour that checks args[0] even if arg_count is 0 sql/mysql_priv.h: Add "have_dlopen" sql/mysqld.cc: Add "have_dlopen" Move HAVE_DLOPEN defined to only surround "udf_free" and "udf_init" sql/set_var.cc: Add "have_dlopen" sql/sql_plugin.cc: Surround 'dlclose' with HAVE_DLOPEN sql/sql_udf.cc: Remove the requirement to load udf's only from "opt_plugin_dir". Fix spelling error
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 69c5388f776..495ffe9f5d5 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -114,7 +114,7 @@ void udf_init()
READ_RECORD read_record_info;
TABLE *table;
int error;
- DBUG_ENTER("ufd_init");
+ DBUG_ENTER("udf_init");
if (initialized)
DBUG_VOID_RETURN;
@@ -177,7 +177,6 @@ void udf_init()
continue;
}
-
if (!(tmp= add_udf(&name,(Item_result) table->field[1]->val_int(),
dl_name, udftype)))
{
@@ -188,13 +187,10 @@ void udf_init()
void *dl = find_udf_dl(tmp->dl);
if (dl == NULL)
{
- char dlpath[FN_REFLEN];
- strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl,
- NullS);
- if (!(dl= dlopen(dlpath, RTLD_NOW)))
+ if (!(dl= dlopen(tmp->dl, RTLD_NOW)))
{
/* Print warning to log */
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, errno, dlerror());
+ sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl, errno, dlerror());
/* Keep the udf in the hash so that we can remove it later */
continue;
}
@@ -415,14 +411,12 @@ int mysql_create_function(THD *thd,udf_func *udf)
}
if (!(dl = find_udf_dl(udf->dl)))
{
- char dlpath[FN_REFLEN];
- strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", udf->dl, NullS);
- if (!(dl = dlopen(dlpath, RTLD_NOW)))
+ if (!(dl = dlopen(udf->dl, RTLD_NOW)))
{
DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)",
- dlpath, errno, dlerror()));
+ udf->dl, errno, dlerror()));
my_error(ER_CANT_OPEN_LIBRARY, MYF(0),
- dlpath, errno, dlerror());
+ udf->dl, errno, dlerror());
goto err;
}
new_dl=1;