MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Andrew Hutchings Date:June 22 2009 6:24pm
Subject:bzr commit into mysql-5.1 branch (Andrew.Hutchings:2953) Bug#45549
View as plain text  
#At file:///home/linuxjedi/Programming/bzr/mysql-5.1-bug-45549/ based on revid:andrew.hutchings@stripped

 2953 Andrew Hutchings	2009-06-22
      Bug #45549 Windows UDF does not work because of '/' to plugin_dir path addition bug
      
      Get sensible error codes for dlopen() in Windows.

    modified:
      sql/sql_plugin.cc
      sql/sql_udf.cc
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-06-20 10:42:39 +0000
+++ b/sql/sql_plugin.cc	2009-06-22 18:24:07 +0000
@@ -387,6 +387,9 @@ static st_plugin_dl *plugin_dl_add(const
   /* Open new dll handle */
   if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW)))
   {
+#if defined(__WIN__)
+    errno = (int) GetLastError();
+#endif 
     const char *errmsg=dlerror();
     if (!strncmp(dlpath, errmsg, dlpathlen))
     { // if errmsg starts from dlpath, trim this prefix.

=== modified file 'sql/sql_udf.cc'
--- a/sql/sql_udf.cc	2009-06-20 10:42:39 +0000
+++ b/sql/sql_udf.cc	2009-06-22 18:24:07 +0000
@@ -201,6 +201,9 @@ void udf_init()
                NullS);
       if (!(dl= dlopen(dlpath, RTLD_NOW)))
       {
+#if defined(__WIN__)
+        errno = (int) GetLastError();
+#endif
 	/* Print warning to log */
         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 */
@@ -454,6 +457,9 @@ int mysql_create_function(THD *thd,udf_f
     strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, seperator, udf->dl, NullS);
     if (!(dl = dlopen(dlpath, RTLD_NOW)))
     {
+#if defined(__WIN__)
+      errno = (int) GetLastError();
+#endif 
       DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)",
                           udf->dl, errno, dlerror()));
       my_error(ER_CANT_OPEN_LIBRARY, MYF(0),


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