mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage engine plugins. Add some accessors specific to the InnoDB storage engine, to allow InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB has additional requirements, due to its foreign key support, etc. include/m_string.h: Add structure tag to LEX_STRING definition, so that it can be referred to by forward declarations. Allow struct st_mysql_lex_string to be defined here, or in mysql/plugin.h. include/my_global.h: Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets some definitions needed for the InnoDB storage engine plugin which do not belong in our general plugin interface. include/mysql/plugin.h: Additional accessors for MySQL internals: - Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from m_string.h) - Full definition of MYSQL_XID (binary compatible with XID from handler.h) - mysql_tmpfile(), creates a temporary file in mysqld's tmpdir - thd_killed(), to check killed state of connection - thd_alloc() and similar allocation functions - thd_get_xid(), to get XID of connection's transaction - mysql_query_cache_invalidate4, to invalidate a table's query cache entries sql/handler.h: Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant definitions sql/log.cc: Add definitions for two InnoDB compatibility hooks: - mysql_bin_log_file(), to get log filename - mysql_bin_log_file_pos, to get position in file These are defined only if INNODB_COMPATIBILITY_HOOKS is defined; they are needed by the InnoDB plugin, but aren't part of the general plugin interface. They are declared in ha_innodb.h for InnoDB's use. sql/mysql_priv.h: Expose some server internals when INNODB_COMPATIBILITY_HOOKS is defined, so that InnoDB can be built as a plugin when MYSQL_SERVER is not defined. Move make_lex_string inside THD class. sql/sql_cache.cc: Add definiton of mysql_query_cache_invalidate4(), a part of the plugin API (mysql/plugin.h). sql/sql_class.cc: Add definitions for several accessor functions which form part of the plugin API (mysql/plugin.h): - mysql_tmpfile() - thd_alloc() and friends - thd_make_lex_string() - thd_get_xid() Add definitons for accessor functions which InnoDB requires, but which are not part of the plugin interface: - thd_charset() - thd_query() - thd_slave_thread() - thd_non_transactional_update() - thd_binlog_format() Move definition of make_lex_string() from sql_show.cc into THD class sql/sql_class.h: Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD class. sql/sql_parse.cc: Use thd->make_lex_string() instead of thd->LEX_STRING_make() sql/sql_show.cc: Move make_lex_string() inside THD class storage/innobase/handler/ha_innodb.cc: Call thd_make_lex_string() instead of make_lex_string().
This commit is contained in:
@ -1182,7 +1182,11 @@ bool mysqld_show_open_tables(THD *thd,const char *wild);
|
||||
bool mysqld_show_logs(THD *thd);
|
||||
void append_identifier(THD *thd, String *packet, const char *name,
|
||||
uint length);
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild);
|
||||
int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd);
|
||||
bool mysqld_show_create(THD *thd, TABLE_LIST *table_list);
|
||||
@ -1211,9 +1215,6 @@ void reset_status_vars();
|
||||
/* information schema */
|
||||
extern LEX_STRING INFORMATION_SCHEMA_NAME;
|
||||
extern const LEX_STRING partition_keywords[];
|
||||
LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
|
||||
const char* str, uint length,
|
||||
bool allocate_lex_string);
|
||||
ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name);
|
||||
ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
|
||||
int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
|
||||
@ -1691,9 +1692,14 @@ extern int creating_table; // How many mysql_create_table() are running
|
||||
*/
|
||||
|
||||
extern time_t server_start_time;
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern uint mysql_data_home_len;
|
||||
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
|
||||
mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
|
||||
mysql_real_data_home[];
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern char *opt_mysql_tmpdir, mysql_charsets_dir[],
|
||||
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
|
||||
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
|
||||
extern MY_TMPDIR mysql_tmpdir_list;
|
||||
@ -1710,8 +1716,13 @@ extern Gt_creator gt_creator;
|
||||
extern Lt_creator lt_creator;
|
||||
extern Ge_creator ge_creator;
|
||||
extern Le_creator le_creator;
|
||||
extern char language[FN_REFLEN], reg_ext[FN_EXTLEN];
|
||||
extern char language[FN_REFLEN];
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern char reg_ext[FN_EXTLEN];
|
||||
extern uint reg_ext_length;
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
|
||||
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
|
||||
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
|
||||
@ -1740,17 +1751,32 @@ extern ulong max_binlog_size, max_relay_log_size;
|
||||
extern ulong opt_binlog_rows_event_max_size;
|
||||
extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
|
||||
extern ulong back_log;
|
||||
extern ulong specialflag, current_pid;
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern ulong specialflag;
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern ulong current_pid;
|
||||
extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter;
|
||||
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
|
||||
extern ulong tc_log_page_waits;
|
||||
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
|
||||
extern uint test_flags,select_errors,ha_open_options;
|
||||
extern uint protocol_version, mysqld_port, dropping_tables;
|
||||
extern uint delay_key_write_options, lower_case_table_names;
|
||||
extern uint delay_key_write_options;
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern uint lower_case_table_names;
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern bool opt_endinfo, using_udf_functions;
|
||||
extern my_bool locked_in_memory;
|
||||
extern bool opt_using_transactions, mysqld_embedded;
|
||||
extern bool opt_using_transactions;
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern bool mysqld_embedded;
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern bool using_update_log, opt_large_files, server_id_supplied;
|
||||
extern bool opt_update_log, opt_bin_log, opt_error_log;
|
||||
extern my_bool opt_log, opt_slow_log;
|
||||
@ -1774,8 +1800,12 @@ extern uint opt_crash_binlog_innodb;
|
||||
extern char *shared_memory_base_name, *mysqld_unix_port;
|
||||
extern my_bool opt_enable_shared_memory;
|
||||
extern char *default_tz_name;
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern my_bool opt_large_pages;
|
||||
extern uint opt_large_page_size;
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern char *opt_logname, *opt_slow_logname;
|
||||
extern const char *log_output_str;
|
||||
|
||||
@ -1811,7 +1841,11 @@ extern MY_BITMAP temp_pool;
|
||||
extern String my_empty_string;
|
||||
extern const String my_null_string;
|
||||
extern SHOW_VAR status_vars[];
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
extern struct system_variables global_system_variables;
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
extern struct system_variables max_system_variables;
|
||||
extern struct system_status_var global_status_var;
|
||||
extern struct rand_struct sql_rand;
|
||||
@ -2009,10 +2043,14 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr);
|
||||
char *fn_rext(char *name);
|
||||
|
||||
/* Conversion functions */
|
||||
#endif /* MYSQL_SERVER */
|
||||
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
|
||||
uint strconvert(CHARSET_INFO *from_cs, const char *from,
|
||||
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
|
||||
uint filename_to_tablename(const char *from, char *to, uint to_length);
|
||||
uint tablename_to_filename(const char *from, char *to, uint to_length);
|
||||
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
|
||||
#ifdef MYSQL_SERVER
|
||||
uint build_table_filename(char *buff, size_t bufflen, const char *db,
|
||||
const char *table, const char *ext, uint flags);
|
||||
|
||||
|
Reference in New Issue
Block a user