[Commits] Rev 4115: MDEV-5862 server_audit test fails in buildbot on Mac (labrador). in file:///home/hf/wmar/mdev-5682/

holyfoot at askmonty.org holyfoot at askmonty.org
Sat Mar 22 16:48:17 EET 2014


At file:///home/hf/wmar/mdev-5682/

------------------------------------------------------------
revno: 4115
revision-id: holyfoot at askmonty.org-20140322132748-gg2ndxvpxe10qyb4
parent: sergii at pisem.net-20140318172907-ra8nysurfm3jip3h
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-5682
timestamp: Sat 2014-03-22 17:27:48 +0400
message:
  MDEV-5862 server_audit test fails in buildbot on Mac (labrador).
          The RTLD_DEFAULT value on Labrador machine is not NULL,
          so the dlsym() commands in the server_audit just fail
          to bind the necessary functions.
          Fixed by using RTLD_DEFAULT explicitly.
-------------- next part --------------
=== modified file 'plugin/server_audit/server_audit.c'
--- a/plugin/server_audit/server_audit.c	2014-03-18 08:26:50 +0000
+++ b/plugin/server_audit/server_audit.c	2014-03-22 13:27:48 +0000
@@ -84,6 +84,9 @@ static void closelog() {}
 #include <typelib.h>
 #include <mysql/plugin.h>
 #include <mysql/plugin_audit.h>
+#ifndef RTLD_DEFAULT
+#define RTLD_DEFAULT NULL
+#endif
 
 #undef my_init_dynamic_array_ci
 #define init_dynamic_array2 loc_init_dynamic_array2
@@ -1451,11 +1454,11 @@ static int server_audit_init(void *p __a
   serv_ver= server_version;
 #endif /*_WIN32*/
 
-  my_hash_init_ptr= dlsym(NULL, "_my_hash_init");
+  my_hash_init_ptr= dlsym(RTLD_DEFAULT, "_my_hash_init");
   if (!my_hash_init_ptr)
   {
     maria_above_5= 1;
-    my_hash_init_ptr= dlsym(NULL, "my_hash_init2");
+    my_hash_init_ptr= dlsym(RTLD_DEFAULT, "my_hash_init2");
   }
 
   if (!serv_ver || !my_hash_init_ptr)
@@ -1513,15 +1516,17 @@ static int server_audit_init(void *p __a
   /* so we warn users if both Query Cashe and TABLE events enabled.      */
   if (!started_mysql && FILTER(EVENT_TABLE))
   {
-    ulonglong *qc_size= (ulonglong *) dlsym(NULL, "query_cache_size");
+    ulonglong *qc_size= (ulonglong *) dlsym(RTLD_DEFAULT, "query_cache_size");
     if (qc_size == NULL || *qc_size != 0)
     {
       struct loc_system_variables *g_sys_var=
-        (struct loc_system_variables *) dlsym(NULL, "global_system_variables");
+        (struct loc_system_variables *) dlsym(RTLD_DEFAULT,
+                                          "global_system_variables");
       if (g_sys_var && g_sys_var->query_cache_type != 0)
       {
         error_header();
-        fprintf(stderr, "Query cache is enabled with the TABLE events. Some table reads can be veiled.");
+        fprintf(stderr, "Query cache is enabled with the TABLE events."
+                        " Some table reads can be veiled.");
       }
     }
   }



More information about the commits mailing list