diff options
author | Michael Widenius <monty@askmonty.org> | 2009-10-14 15:58:53 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-10-14 15:58:53 +0300 |
commit | daccf1748344e011267ad3f0f093c49c6530d050 (patch) | |
tree | ce464eb370e989b1ba3c6edc2dfc96444791fc13 /sql/mysql_priv.h | |
parent | 115f4b275a640fc46dd295cc8654e995a91a3885 (diff) | |
parent | 75a949fb414f8b3ed851a466d84788085c9dbe42 (diff) | |
download | mariadb-git-daccf1748344e011267ad3f0f093c49c6530d050.tar.gz |
Merge with 5.1
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 132 |
1 files changed, 93 insertions, 39 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 816efe05c18..525ce3fa1d0 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -43,6 +43,7 @@ #include "sql_array.h" #include "sql_plugin.h" #include "scheduler.h" +#include "log_slow.h" class Parser_state; @@ -82,9 +83,9 @@ extern query_id_t global_query_id; inline query_id_t next_query_id() { return global_query_id++; } /* useful constants */ -extern const key_map key_map_empty; -extern key_map key_map_full; /* Should be threaded as const */ -extern const char *primary_key_name; +extern MYSQL_PLUGIN_IMPORT const key_map key_map_empty; +extern MYSQL_PLUGIN_IMPORT key_map key_map_full; /* Should be threaded as const */ +extern MYSQL_PLUGIN_IMPORT const char *primary_key_name; #include "mysql_com.h" #include <violite.h> @@ -123,8 +124,10 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); "in MySQL %s. Please use %s instead.", (Old), (Ver), (New)); \ } while(0) -extern CHARSET_INFO *system_charset_info, *files_charset_info ; -extern CHARSET_INFO *national_charset_info, *table_alias_charset; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset; enum Derivation @@ -363,6 +366,11 @@ protected: #define PRECISION_FOR_DOUBLE 53 #define PRECISION_FOR_FLOAT 24 +/* -[digits].E+## */ +#define MAX_FLOAT_STR_LENGTH (FLT_DIG + 6) +/* -[digits].E+### */ +#define MAX_DOUBLE_STR_LENGTH (DBL_DIG + 7) + /* Default time to wait before aborting a new client connection that does not respond to "initial server greeting" timely @@ -528,14 +536,27 @@ protected: #define OPTIMIZER_SWITCH_INDEX_MERGE_UNION 2 #define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION 4 #define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT 8 -#define OPTIMIZER_SWITCH_LAST 16 -/* The following must be kept in sync with optimizer_switch_str in mysqld.cc */ -#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ - OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ - OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ - OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT) +#ifdef DBUG_OFF +# define OPTIMIZER_SWITCH_LAST 16 +#else +# define OPTIMIZER_SWITCH_TABLE_ELIMINATION 16 +# define OPTIMIZER_SWITCH_LAST 32 +#endif +#ifdef DBUG_OFF +/* The following must be kept in sync with optimizer_switch_str in mysqld.cc */ +# define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ + OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ + OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ + OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT) +#else +# define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ + OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ + OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ + OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \ + OPTIMIZER_SWITCH_TABLE_ELIMINATION) +#endif /* Replication uses 8 bytes to store SQL_MODE in the binary log. The day you @@ -632,6 +653,7 @@ enum enum_parsing_place struct st_table; +#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__) class THD; enum enum_check_fields @@ -641,6 +663,7 @@ enum enum_check_fields CHECK_FIELD_ERROR_FOR_NULL }; + /** Struct to handle simple linked lists. */ typedef struct st_sql_list { uint elements; @@ -683,14 +706,19 @@ typedef struct st_sql_list { } } SQL_LIST; - +#if defined(MYSQL_DYNAMIC_PLUGIN) && defined(_WIN32) +extern "C" THD *_current_thd_noinline(); +#define _current_thd() _current_thd_noinline() +#else extern pthread_key(THD*, THR_THD); inline THD *_current_thd(void) { return my_pthread_getspecific_ptr(THD*,THR_THD); } +#endif #define current_thd _current_thd() + /** The meat of thd_proc_info(THD*, char*), a macro that packs the last three calling-info parameters. @@ -919,7 +947,6 @@ struct Query_cache_query_flags #define query_cache_abort(A) #define query_cache_end_of_result(A) -#define query_cache_invalidate_by_MyISAM_filename_ref NULL #define query_cache_maybe_disabled(T) 1 #define query_cache_is_cacheable_query(L) 0 #endif /*HAVE_QUERY_CACHE*/ @@ -1412,14 +1439,14 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table); /* sql_prepare.cc */ -void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length); -void mysql_stmt_execute(THD *thd, char *packet, uint packet_length); -void mysql_stmt_close(THD *thd, char *packet); +void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length); +void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length); +void mysqld_stmt_close(THD *thd, char *packet); void mysql_sql_stmt_prepare(THD *thd); void mysql_sql_stmt_execute(THD *thd); void mysql_sql_stmt_close(THD *thd); -void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length); -void mysql_stmt_reset(THD *thd, char *packet); +void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length); +void mysqld_stmt_reset(THD *thd, char *packet); void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length); void reinit_stmt_before_use(THD *thd, LEX *lex); @@ -1881,8 +1908,12 @@ extern time_t server_start_time, flush_status_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[], mysql_unpacked_real_data_home[]; + +extern MYSQL_PLUGIN_IMPORT char *mysql_data_home; +extern char server_version[SERVER_VERSION_LENGTH]; +extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[]; +extern char mysql_unpacked_real_data_home[]; + extern CHARSET_INFO *character_set_filesystem; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER @@ -1890,10 +1921,13 @@ extern char *opt_mysql_tmpdir, mysql_charsets_dir[], def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; extern int mysql_unpacked_real_data_home_len; #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list)) -extern MY_TMPDIR mysql_tmpdir_list; +extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list; extern const LEX_STRING command_name[]; -extern const char *first_keyword, *my_localhost, *delayed_user, *binary_keyword; -extern const char **errmesg; /* Error messages */ + +extern const char *first_keyword, *delayed_user, *binary_keyword; +extern MYSQL_PLUGIN_IMPORT const char *my_localhost; +extern MYSQL_PLUGIN_IMPORT const char **errmesg; /* Error messages */ + extern const char *myisam_recover_options_str; extern const char *in_left_expr_name, *in_additional_cond, *in_having_cond; extern const char * const TRG_EXT; @@ -1907,8 +1941,8 @@ extern Le_creator le_creator; 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; +extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN]; +extern MYSQL_PLUGIN_IMPORT uint reg_ext_length; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; @@ -1928,21 +1962,23 @@ extern ulong slave_open_temp_tables; extern ulong query_cache_size, query_cache_min_res_unit; extern ulong slow_launch_threads, slow_launch_time; extern ulong table_cache_size, table_def_size; -extern ulong max_connections,max_connect_errors, connect_timeout; +extern MYSQL_PLUGIN_IMPORT ulong max_connections; +extern ulong max_connect_errors, connect_timeout; extern ulong extra_max_connections; extern ulong slave_net_timeout, slave_trans_retries; extern uint max_user_connections; extern ulong what_to_log,flush_time; extern ulong query_buff_size; extern ulong max_prepared_stmt_count, prepared_stmt_count; -extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit; +extern ulong binlog_cache_size, open_files_limit; +extern ulonglong max_binlog_cache_size; 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; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS -extern ulong specialflag; +extern ulong MYSQL_PLUGIN_IMPORT specialflag; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER extern ulong current_pid; @@ -1955,7 +1991,7 @@ extern uint protocol_version, mysqld_port, mysqld_extra_port, dropping_tables; extern uint delay_key_write_options; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS -extern uint lower_case_table_names; +extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER extern bool opt_endinfo, using_udf_functions; @@ -1963,7 +1999,7 @@ extern my_bool locked_in_memory; extern bool opt_using_transactions; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS -extern bool mysqld_embedded; +extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER extern bool opt_large_files, server_id_supplied; @@ -1975,6 +2011,7 @@ extern bool opt_disable_networking, opt_skip_show_db; extern bool opt_ignore_builtin_innodb; extern my_bool opt_character_set_client_handshake; extern bool volatile abort_loop, shutdown_in_progress; +extern bool in_bootstrap; extern uint volatile thread_count, thread_running, global_read_lock; extern ulong thread_created; extern uint connection_count, extra_connection_count; @@ -2002,7 +2039,7 @@ extern uint opt_large_page_size; extern char *opt_logname, *opt_slow_logname; extern const char *log_output_str; -extern MYSQL_BIN_LOG mysql_bin_log; +extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log; extern LOGGER logger; extern TABLE_LIST general_log, slow_log; extern FILE *bootstrap_file; @@ -2010,14 +2047,14 @@ extern int bootstrap_error; extern FILE *stderror_file; extern pthread_key(MEM_ROOT**,THR_MALLOC); extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db, - LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status, + LOCK_mapped_file,LOCK_user_locks, LOCK_status, LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator, LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone, LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock, LOCK_global_system_variables, LOCK_user_conn, LOCK_prepared_stmt_count, - LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count, - LOCK_uuid_short; + LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count; +extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count; #ifdef HAVE_OPENSSL extern pthread_mutex_t LOCK_des_key_file; #endif @@ -2037,16 +2074,13 @@ 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; +extern MYSQL_PLUGIN_IMPORT 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 my_rnd_struct sql_rand; -extern handlerton *maria_hton; /* @todo remove, make it static in ha_maria.cc - currently it's needed for sql_delete.cc */ - extern const char *opt_date_time_formats[]; extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[]; @@ -2063,10 +2097,14 @@ extern uint sql_command_flags[]; extern TYPELIB log_output_typelib; /* optional things, have_* variables */ -extern SHOW_COMP_OPTION have_maria_db; extern SHOW_COMP_OPTION have_community_features; + extern handlerton *partition_hton; extern handlerton *myisam_hton; +/* + @todo remove, make it static in ha_maria.cc + currently it's needed for sql_select.cc +*/ extern handlerton *maria_hton; extern handlerton *heap_hton; @@ -2259,6 +2297,16 @@ char *fn_rext(char *name); #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); +/* depends on errmsg.txt Database `db`, Table `t` ... */ +#define EXPLAIN_FILENAME_MAX_EXTRA_LENGTH 63 +enum enum_explain_filename_mode +{ + EXPLAIN_ALL_VERBOSE= 0, + EXPLAIN_PARTITIONS_VERBOSE, + EXPLAIN_PARTITIONS_AS_COMMENT +}; +uint explain_filename(const char *from, char *to, uint to_length, + enum_explain_filename_mode explain_mode); uint filename_to_tablename(const char *from, char *to, uint to_length); uint tablename_to_filename(const char *from, char *to, uint to_length); uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length); @@ -2317,6 +2365,12 @@ extern void turn_parser_debug_on(); SQL_CRYPT *get_crypt_for_frm(void); #endif +/* password.c */ +extern "C" void my_make_scrambled_password_323(char *to, const char *password, + size_t pass_len); +extern "C" void my_make_scrambled_password(char *to, const char *password, + size_t pass_len); + #include "sql_view.h" /* Some inline functions for more speed */ |