You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.3 KiB

branches/zip: implement the delayloading of externals for the plugin on Windows, which includes: * Load mysqld.map and insert all symbol/address pairs into hash for quick access * Resolves all external data variables. The delayloading mechanism in MSVC does not support automatic imports of data variables. A workaround is to explicitly handle the data import using the delay loader during the initialization of the plugin. * Resolves all external functions during run-time, by implementing the delayed loading helper function delayLoadHelper2, which is called by run-time as well as HrLoadAllImportsForDll. The delay loader reuses the hash implementation in InnoDB. The normal hash_create (in hash0hash.c) creates hash tables in buffer pool. But the delay loader is invoked before the engine is initialized, and buffer pools are not ready yet. Instead, the delay loader has its own implementation of hash_create() and hash_table_free(), called wdl_hash_create() and wdl_hash_table_free(). This patch should be used with other two patches in order to build a dynamically linked plugin on Windows: * patch for tmpfile functions (r2886) * patch for "build" files (to be committed) The list of file changed: handler/handler0vars.h: new file, defines a list of external data variables (no external functions). handler/win_delay_loader.cc: new file, the implementation of the delay loader for Windows plugin. handler/ha_innodb.cc: add a header file, and changes for copying the system variables. handler/handler0alter.cc: add a header file handler/i_s.cc: add a header file rb://27 Reviewed by: Sunny, Marko Approved by: Sunny
17 years ago
  1. /***********************************************************************
  2. This file contains accessor functions for dynamic plugin on Windows.
  3. (c) 2008 Innobase Oy
  4. ***********************************************************************/
  5. #if defined __WIN__ && defined MYSQL_DYNAMIC_PLUGIN
  6. /***********************************************************************
  7. This is a list of externals that can not be resolved by delay loading.
  8. They have to be resolved indirectly via their addresses in the .map file.
  9. All of them are external variables. */
  10. extern CHARSET_INFO* wdl_my_charset_bin;
  11. extern CHARSET_INFO* wdl_my_charset_latin1;
  12. extern CHARSET_INFO* wdl_my_charset_filename;
  13. extern CHARSET_INFO** wdl_system_charset_info;
  14. extern CHARSET_INFO** wdl_default_charset_info;
  15. extern CHARSET_INFO** wdl_all_charsets;
  16. extern system_variables* wdl_global_system_variables;
  17. extern char* wdl_mysql_real_data_home;
  18. extern char** wdl_mysql_data_home;
  19. extern char** wdl_tx_isolation_names;
  20. extern char** wdl_binlog_format_names;
  21. extern char* wdl_reg_ext;
  22. extern pthread_mutex_t* wdl_LOCK_thread_count;
  23. extern key_map* wdl_key_map_full;
  24. extern MY_TMPDIR* wdl_mysql_tmpdir_list;
  25. extern bool* wdl_mysqld_embedded;
  26. extern uint* wdl_lower_case_table_names;
  27. extern ulong* wdl_specialflag;
  28. extern int* wdl_my_umask;
  29. #define my_charset_bin (*wdl_my_charset_bin)
  30. #define my_charset_latin1 (*wdl_my_charset_latin1)
  31. #define my_charset_filename (*wdl_my_charset_filename)
  32. #define system_charset_info (*wdl_system_charset_info)
  33. #define default_charset_info (*wdl_default_charset_info)
  34. #define all_charsets (wdl_all_charsets)
  35. #define global_system_variables (*wdl_global_system_variables)
  36. #define mysql_real_data_home (wdl_mysql_real_data_home)
  37. #define mysql_data_home (*wdl_mysql_data_home)
  38. #define tx_isolation_names (*wdl_tx_isolation_names)
  39. #define binlog_format_names (*wdl_binlog_format_names)
  40. #define reg_ext (wdl_reg_ext)
  41. #define LOCK_thread_count (*wdl_LOCK_thread_count)
  42. #define key_map_full (*wdl_key_map_full)
  43. #define mysql_tmpdir_list (*wdl_mysql_tmpdir_list)
  44. #define mysqld_embedded (*wdl_mysqld_embedded)
  45. #define lower_case_table_names (*wdl_lower_case_table_names)
  46. #define specialflag (*wdl_specialflag)
  47. #define my_umask (*wdl_my_umask)
  48. #endif