From f0cf48a0c450d5cb4f3bd4f89a3e0b2135403e56 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 8 Mar 2010 14:57:32 +0100 Subject: small code cleanup - "good ifdef is no ifdef" --- sql/sql_plugin.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/sql_plugin.h') diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 004d0d5abb7..54ef38b3734 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -89,6 +89,8 @@ struct st_plugin_int */ #ifdef DBUG_OFF typedef struct st_plugin_int *plugin_ref; +#define plugin_ref_to_int(A) A +#define plugin_int_to_ref(A) A #define plugin_decl(pi) ((pi)->plugin) #define plugin_dlib(pi) ((pi)->plugin_dl) #define plugin_data(pi,cast) ((cast)((pi)->data)) @@ -97,6 +99,8 @@ typedef struct st_plugin_int *plugin_ref; #define plugin_equals(p1,p2) ((p1) == (p2)) #else typedef struct st_plugin_int **plugin_ref; +#define plugin_ref_to_int(A) (A ? A[0] : NULL) +#define plugin_int_to_ref(A) &(A) #define plugin_decl(pi) ((pi)[0]->plugin) #define plugin_dlib(pi) ((pi)[0]->plugin_dl) #define plugin_data(pi,cast) ((cast)((pi)[0]->data)) @@ -120,7 +124,7 @@ extern bool plugin_is_ready(const LEX_STRING *name, int type); #define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO) #define my_plugin_lock(A,B) plugin_lock(A,B CALLER_INFO) #define my_plugin_lock_ci(A,B) plugin_lock(A,B ORIG_CALLER_INFO) -extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO); +extern plugin_ref plugin_lock(THD *thd, plugin_ref ptr CALLER_INFO_PROTO); extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type CALLER_INFO_PROTO); extern void plugin_unlock(THD *thd, plugin_ref plugin); -- cgit v1.2.1 From 71b3e46b0160936596195682a731703900fb4fff Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 12 Mar 2010 20:05:21 +0100 Subject: 1. don't crash on failing to load a plugin with newer MYSQL_PLUGIN_INTERFACE_VERSION 2. don't copy st_mysql_plugin structure unnecessary (sizeof hasn't changed) --- sql/sql_plugin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_plugin.h') diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 54ef38b3734..79ee296ac64 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -63,7 +63,8 @@ struct st_plugin_dl LEX_STRING dl; void *handle; struct st_mysql_plugin *plugins; - int version; + int version; + bool allocated; uint ref_count; /* number of plugins loaded from the library */ }; -- cgit v1.2.1