From 6cddd12ad6eeea82b1087574e5dd5cb9accd7641 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 5 Mar 2017 15:50:32 +0100 Subject: make sql_udf.cc to shorten dlerror() messages just as sql_plugin.cc does --- sql/sql_udf.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sql/sql_udf.cc') diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index aa4859b6639..4ccd4948b58 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -227,14 +227,13 @@ void udf_init() if (dl == NULL) { char dlpath[FN_REFLEN]; - strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl, - NullS); + strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl, NullS); (void) unpack_filename(dlpath, dlpath); if (!(dl= dlopen(dlpath, RTLD_NOW))) { /* Print warning to log */ sql_print_error(ER_THD(new_thd, ER_CANT_OPEN_LIBRARY), - tmp->dl, errno, dlerror()); + tmp->dl, errno, my_dlerror(dlpath)); /* Keep the udf in the hash so that we can remove it later */ continue; } @@ -538,10 +537,10 @@ int mysql_create_function(THD *thd,udf_func *udf) if (!(dl = dlopen(dlpath, RTLD_NOW))) { + my_error(ER_CANT_OPEN_LIBRARY, MYF(0), + udf->dl, errno, my_dlerror(dlpath)); DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)", udf->dl, errno, dlerror())); - my_error(ER_CANT_OPEN_LIBRARY, MYF(0), - udf->dl, errno, dlerror()); goto err; } new_dl=1; -- cgit v1.2.1