diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-06-10 10:59:49 +0200 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-06-10 10:59:49 +0200 |
commit | 768bbae90eb116349940821a1fb48920291ddd97 (patch) | |
tree | 41fa2696a71a46f4885a21cf7c58dc438a600d7a /include | |
parent | b6312995f1eb1478c8af30452c99e9b94b5f8185 (diff) | |
download | mariadb-git-768bbae90eb116349940821a1fb48920291ddd97.tar.gz |
Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use
symbols exported from mysqld.
storage/innodb_plugin/handler/ha_innodb.cc:
Remove a Win32 workaround for current_thd.
The original problem that innodb plugin used
value of TLS variable across DLL boundaries is
solved in MySQL server (current_thd is a function
not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
Remove custom delay loader
storage/innodb_plugin/plug.in:
Remove commented out MYSQL_PLUGIN_STATIC,
CMake would not parse that correctly
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 6 | ||||
-rw-r--r-- | include/my_global.h | 13 | ||||
-rw-r--r-- | include/my_sys.h | 8 | ||||
-rw-r--r-- | include/mysql/plugin.h | 16 |
4 files changed, 33 insertions, 10 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 04cf921dfee..451c8db549b 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -285,7 +285,7 @@ typedef struct charset_info_st #define ILLEGAL_CHARSET_INFO_NUMBER (~0U) -extern CHARSET_INFO my_charset_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; extern CHARSET_INFO my_charset_big5_chinese_ci; extern CHARSET_INFO my_charset_big5_bin; extern CHARSET_INFO my_charset_cp932_japanese_ci; @@ -298,7 +298,7 @@ extern CHARSET_INFO my_charset_gb2312_chinese_ci; extern CHARSET_INFO my_charset_gb2312_bin; extern CHARSET_INFO my_charset_gbk_chinese_ci; extern CHARSET_INFO my_charset_gbk_bin; -extern CHARSET_INFO my_charset_latin1; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; extern CHARSET_INFO my_charset_latin1_german2_ci; extern CHARSET_INFO my_charset_latin1_bin; extern CHARSET_INFO my_charset_latin2_czech_ci; @@ -315,7 +315,7 @@ extern CHARSET_INFO my_charset_utf8_general_ci; extern CHARSET_INFO my_charset_utf8_unicode_ci; extern CHARSET_INFO my_charset_utf8_bin; extern CHARSET_INFO my_charset_cp1250_czech_ci; -extern CHARSET_INFO my_charset_filename; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; /* declarations for simple charsets */ extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, diff --git a/include/my_global.h b/include/my_global.h index 9e8c9bdfc70..996972c1411 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1573,4 +1573,17 @@ static inline double rint(double x) } #endif /* HAVE_RINT */ +/* + MYSQL_PLUGIN_IMPORT macro is used to export mysqld data + (i.e variables) for usage in storage engine loadable plugins. + Outside of Windows, it is dummy. +*/ +#ifndef MYSQL_PLUGIN_IMPORT +#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN)) +#define MYSQL_PLUGIN_IMPORT __declspec(dllimport) +#else +#define MYSQL_PLUGIN_IMPORT +#endif +#endif + #endif /* my_global_h */ diff --git a/include/my_sys.h b/include/my_sys.h index 01804cd089f..a5ebe2bb909 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -221,8 +221,8 @@ extern uint my_large_page_size; #endif /* charsets */ -extern CHARSET_INFO *default_charset_info; -extern CHARSET_INFO *all_charsets[256]; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[256]; extern CHARSET_INFO compiled_charsets[]; /* statistics */ @@ -237,8 +237,8 @@ extern void (*my_sigtstp_cleanup)(void), (*my_sigtstp_restart)(void), (*my_abort_hook)(int); /* Executed when comming from shell */ -extern int NEAR my_umask, /* Default creation mask */ - NEAR my_umask_dir, +extern MYSQL_PLUGIN_IMPORT int NEAR my_umask; /* Default creation mask */ +extern int NEAR my_umask_dir, NEAR my_recived_signals, /* Signals we have got */ NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ NEAR my_dont_interrupt; /* call remember_intr when set */ diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index a978d44b918..2e59262d061 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -16,6 +16,16 @@ #ifndef _my_plugin_h #define _my_plugin_h + +/* + On Windows, exports from DLL need to be declared +*/ +#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN)) +#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) +#else +#define MYSQL_PLUGIN_EXPORT +#endif + #ifdef __cplusplus class THD; class Item; @@ -90,9 +100,9 @@ int PSIZE= sizeof(struct st_mysql_plugin); \ struct st_mysql_plugin DECLS[]= { #else #define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ -int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \ -int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \ -struct st_mysql_plugin _mysql_plugin_declarations_[]= { +MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \ +MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \ +MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= { #endif #define mysql_declare_plugin(NAME) \ |