List:Commits« Previous MessageNext Message »
From:Andrew Hutchings Date:June 20 2009 10:42am
Subject:bzr commit into mysql-5.1 branch (Andrew.Hutchings:2952) Bug#45549
View as plain text  
#At file:///home/linuxjedi/Programming/bzr/mysql-5.1-bug-45549/ based on revid:jperkin@stripped

 2952 Andrew Hutchings	2009-06-20
      Bug #45549 Windows UDF does not work because of '/' to plugin_dir path addition bug
      
      Fix plugin and udf paths to work in Windows by using FN_LIBCHAR instead of '/' and formating the default plugin_dir variable for the OS in use.

    modified:
      sql/mysqld.cc
      sql/sql_plugin.cc
      sql/sql_udf.cc
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-06-08 22:05:24 +0000
+++ b/sql/mysqld.cc	2009-06-20 10:42:39 +0000
@@ -8566,6 +8566,7 @@ static int fix_paths(void)
   (void) my_load_path(pidfile_name,pidfile_name,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, NullS);
   opt_plugin_dir_ptr= opt_plugin_dir;
 
   char *sharedir=get_relative_path(SHAREDIR);

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-05-18 08:10:30 +0000
+++ b/sql/sql_plugin.cc	2009-06-20 10:42:39 +0000
@@ -353,6 +353,7 @@ static st_plugin_dl *plugin_dl_add(const
   uint plugin_dir_len, dummy_errors, dlpathlen;
   struct st_plugin_dl *tmp, plugin_dl;
   void *sym;
+  char seperator[2] = {FN_LIBCHAR,'\0'};
   DBUG_ENTER("plugin_dl_add");
   plugin_dir_len= strlen(opt_plugin_dir);
   /*
@@ -380,7 +381,7 @@ static st_plugin_dl *plugin_dl_add(const
   bzero(&plugin_dl, sizeof(plugin_dl));
   /* Compile dll path */
   dlpathlen=
-    strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) -
+    strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, seperator, dl->str, NullS) -
     dlpath;
   plugin_dl.ref_count= 1;
   /* Open new dll handle */

=== modified file 'sql/sql_udf.cc'
--- a/sql/sql_udf.cc	2009-05-15 12:57:51 +0000
+++ b/sql/sql_udf.cc	2009-06-20 10:42:39 +0000
@@ -196,7 +196,8 @@ void udf_init()
     if (dl == NULL)
     {
       char dlpath[FN_REFLEN];
-      strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl,
+      char seperator[2] = {FN_LIBCHAR, '\0'};
+      strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, seperator, tmp->dl,
                NullS);
       if (!(dl= dlopen(dlpath, RTLD_NOW)))
       {
@@ -449,7 +450,8 @@ int mysql_create_function(THD *thd,udf_f
   if (!(dl = find_udf_dl(udf->dl)))
   {
     char dlpath[FN_REFLEN];
-    strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", udf->dl, NullS);
+    char seperator[2] = {FN_LIBCHAR, '\0'};
+    strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, seperator, udf->dl, NullS);
     if (!(dl = dlopen(dlpath, RTLD_NOW)))
     {
       DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)",


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-5.1 branch (Andrew.Hutchings:2952) Bug#45549Andrew Hutchings20 Jun