diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2014-03-23 18:44:48 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2014-03-23 18:44:48 +0400 |
commit | 0c84a47c972935d62398321c129c3bbb545c4d43 (patch) | |
tree | b9179ec3156b87a4e029e384b1885711bb17aaf3 /plugin | |
parent | 0f6505456be728dbf196af18ef4e67ce93e9047a (diff) | |
download | mariadb-git-0c84a47c972935d62398321c129c3bbb545c4d43.tar.gz |
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.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/server_audit/server_audit.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 3957f39b1d6..c8e5f72f094 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -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 __attribute__((unused))) 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 __attribute__((unused))) /* 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."); } } } |