summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@oracle.com>2012-01-18 00:35:53 +0200
committerAndrei Elkin <andrei.elkin@oracle.com>2012-01-18 00:35:53 +0200
commit8c894564abc55b228cfe9dd87ecde9a7710d94db (patch)
tree04d9d84b9667740c68112896a735cb7726039cea /sql
parent7cdd7a7493d080a7e6cce32eb950999fbfd29167 (diff)
parenta72f7ee6a3717f21b7156a5a3dd2d4b034564b4e (diff)
downloadmariadb-git-8c894564abc55b228cfe9dd87ecde9a7710d94db.tar.gz
merging from the 5.5 repo to local branch.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc6
-rw-r--r--sql/sql_plugin.cc8
-rw-r--r--sql/sql_udf.cc17
3 files changed, 24 insertions, 7 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 6afc20141e1..31257777b27 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -7476,8 +7476,10 @@ static int fix_paths(void)
(void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir
(void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
(void) my_load_path(pidfile_name, pidfile_name_ptr, mysql_real_data_home);
- (void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
- get_relative_path(PLUGINDIR), mysql_home);
+
+ convert_dirname(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
+ get_relative_path(PLUGINDIR), NullS);
+ (void) my_load_path(opt_plugin_dir, opt_plugin_dir, mysql_home);
opt_plugin_dir_ptr= opt_plugin_dir;
my_realpath(mysql_unpacked_real_data_home, mysql_real_data_home, MYF(0));
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 2b801b65a09..4a2d450f373 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -463,18 +463,22 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
dlpathlen=
strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) -
dlpath;
+ (void) unpack_filename(dlpath, dlpath);
plugin_dl.ref_count= 1;
/* Open new dll handle */
if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW)))
{
- const char *errmsg=dlerror();
+ const char *errmsg;
+ int error_number= dlopen_errno;
+ DLERROR_GENERATE(errmsg, error_number);
+
if (!strncmp(dlpath, errmsg, dlpathlen))
{ // if errmsg starts from dlpath, trim this prefix.
errmsg+=dlpathlen;
if (*errmsg == ':') errmsg++;
if (*errmsg == ' ') errmsg++;
}
- report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, error_number, errmsg);
DBUG_RETURN(0);
}
/* Determine interface version */
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index bf2de4b39bb..44595ace453 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -221,10 +221,15 @@ void udf_init()
char dlpath[FN_REFLEN];
strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl,
NullS);
+ (void) unpack_filename(dlpath, dlpath);
if (!(dl= dlopen(dlpath, RTLD_NOW)))
{
+ const char *errmsg;
+ int error_number= dlopen_errno;
+ DLERROR_GENERATE(errmsg, error_number);
+
/* Print warning to log */
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl, errno, dlerror());
+ sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl, error_number, errmsg);
/* Keep the udf in the hash so that we can remove it later */
continue;
}
@@ -469,12 +474,18 @@ int mysql_create_function(THD *thd,udf_func *udf)
{
char dlpath[FN_REFLEN];
strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", udf->dl, NullS);
+ (void) unpack_filename(dlpath, dlpath);
+
if (!(dl = dlopen(dlpath, RTLD_NOW)))
{
+ const char *errmsg;
+ int error_number= dlopen_errno;
+ DLERROR_GENERATE(errmsg, error_number);
+
DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)",
- udf->dl, errno, dlerror()));
+ udf->dl, error_number, errmsg));
my_error(ER_CANT_OPEN_LIBRARY, MYF(0),
- udf->dl, errno, dlerror());
+ udf->dl, error_number, errmsg);
goto err;
}
new_dl=1;