[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
Sun Mar 23 18:02:17 EET 2014


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

------------------------------------------------------------
revno: 4115
revision-id: holyfoot at askmonty.org-20140323144448-ehflksuvchgcr49y
parent: sergii at pisem.net-20140318172907-ra8nysurfm3jip3h
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-5682
timestamp: Sun 2014-03-23 18:44: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-23 14:44: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
@@ -110,6 +113,20 @@ static void closelog() {}
 #define pop_dynamic loc_pop_dynamic
 #define delete_dynamic loc_delete_dynamic
 uchar *loc_alloc_dynamic(DYNAMIC_ARRAY *array);
+#ifdef my_strnncoll
+#undef my_strnncoll
+#define my_strnncoll(s, a, b, c, d) (my_strnncoll_binary((s), (a), (b), (c), (d), 0))
+#endif
+
+static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
+    const uchar *s, size_t slen,
+    const uchar *t, size_t tlen,
+    my_bool t_is_prefix)
+{
+  size_t len=min(slen,tlen);
+  int cmp= memcmp(s,t,len);
+  return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen);
+}
 
 #include "../../mysys/array.c"
 #include "../../mysys/hash.c"
@@ -1451,11 +1468,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 +1530,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