diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-07-23 17:13:36 -0300 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-07-23 17:13:36 -0300 |
commit | dd14fa18afab0477bbc833b7f02f88fb977e79ae (patch) | |
tree | ad51351f695978140f847012d093d17a18062b38 | |
parent | 9fd9857e0bd02932543c03495599b19ea081031c (diff) | |
download | mariadb-git-dd14fa18afab0477bbc833b7f02f88fb977e79ae.tar.gz |
WL#5498: Remove dead and unused source code
Remove unused variables.
-rw-r--r-- | include/lf.h | 5 | ||||
-rw-r--r-- | include/myisam.h | 2 | ||||
-rw-r--r-- | libmysql/libmysql.c | 7 | ||||
-rw-r--r-- | mysys/lf_alloc-pin.c | 6 | ||||
-rw-r--r-- | mysys/lf_hash.c | 2 | ||||
-rw-r--r-- | sql/field.h | 1 | ||||
-rw-r--r-- | sql/item_geofunc.cc | 2 | ||||
-rw-r--r-- | sql/log.h | 1 | ||||
-rw-r--r-- | sql/mysqld.cc | 17 | ||||
-rw-r--r-- | sql/mysqld.h | 9 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 3 | ||||
-rw-r--r-- | sql/repl_failsafe.h | 2 | ||||
-rw-r--r-- | sql/set_var.h | 1 | ||||
-rw-r--r-- | sql/slave.cc | 1 | ||||
-rw-r--r-- | sql/sql_lex.cc | 1 | ||||
-rw-r--r-- | sql/sql_lex.h | 2 | ||||
-rw-r--r-- | sql/sql_priv.h | 2 | ||||
-rw-r--r-- | sql/sys_vars.cc | 2 | ||||
-rw-r--r-- | storage/myisam/mi_static.c | 1 | ||||
-rw-r--r-- | storage/perfschema/pfs_events_waits.cc | 1 |
20 files changed, 10 insertions, 58 deletions
diff --git a/include/lf.h b/include/lf.h index d1f592d1047..e9fb094493f 100644 --- a/include/lf.h +++ b/include/lf.h @@ -187,8 +187,6 @@ typedef struct st_lf_allocator { uchar * volatile top; uint element_size; uint32 volatile mallocs; - void (*constructor)(uchar *); /* called, when an object is malloc()'ed */ - void (*destructor)(uchar *); /* called, when an object is free()'d */ } LF_ALLOCATOR; void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset); @@ -222,8 +220,7 @@ C_MODE_START #define LF_HASH_UNIQUE 1 -/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */ -extern const int LF_HASH_OVERHEAD; +/* lf_hash overhead per element is sizeof(LF_SLIST). */ typedef struct { LF_DYNARRAY array; /* hash itself */ diff --git a/include/myisam.h b/include/myisam.h index 7547f6b475e..450b1cf366c 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -252,7 +252,7 @@ extern ulong myisam_block_size; extern uint myisam_concurrent_insert; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_off_t myisam_max_temp_length; -extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size; +extern ulong myisam_data_pointer_size; /* usually used to check if a symlink points into the mysql data home */ /* which is normally forbidden */ diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 02ed93fa501..550b1b7b107 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -214,13 +214,6 @@ void STDCALL mysql_server_end() } mysql_client_init= org_my_init_done= 0; -#ifdef EMBEDDED_SERVER - if (stderror_file) - { - fclose(stderror_file); - stderror_file= 0; - } -#endif } static MYSQL_PARAMETERS mysql_internal_parameters= diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index c264d3ac4c5..4ed01ac8083 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -448,8 +448,6 @@ void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset) allocator->top= 0; allocator->mallocs= 0; allocator->element_size= size; - allocator->constructor= 0; - allocator->destructor= 0; DBUG_ASSERT(size >= sizeof(void*) + free_ptr_offset); } @@ -470,8 +468,6 @@ void lf_alloc_destroy(LF_ALLOCATOR *allocator) while (node) { uchar *tmp= anext_node(node); - if (allocator->destructor) - allocator->destructor(node); my_free(node); node= tmp; } @@ -500,8 +496,6 @@ void *_lf_alloc_new(LF_PINS *pins) if (!node) { node= (void *)my_malloc(allocator->element_size, MYF(MY_WME)); - if (allocator->constructor) - allocator->constructor(node); #ifdef MY_LF_EXTRA_DEBUG if (likely(node != 0)) my_atomic_add32(&allocator->mallocs, 1); diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 9c51ff1766e..e7bf82fc6ca 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -41,8 +41,6 @@ typedef struct { */ } LF_SLIST; -const int LF_HASH_OVERHEAD= sizeof(LF_SLIST); - /* a structure to pass the context (pointers two the three successive elements in a list) from lfind to linsert/ldelete diff --git a/sql/field.h b/sql/field.h index 46d8a2aa6d9..53d15c63494 100644 --- a/sql/field.h +++ b/sql/field.h @@ -32,7 +32,6 @@ #include "sql_error.h" /* MYSQL_ERROR */ #define DATETIME_DEC 6 -const uint32 max_field_size= (uint32) 4294967295U; class Send_field; class Protocol; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index e046087b16a..d734b55a970 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -49,7 +49,7 @@ void Item_geometry_func::fix_length_and_dec() { collation.set(&my_charset_bin); decimals=0; - max_length= max_field_size; + max_length= (uint32) 4294967295U; maybe_null= 1; } diff --git a/sql/log.h b/sql/log.h index 4a58c3081d8..6e87b6cbade 100644 --- a/sql/log.h +++ b/sql/log.h @@ -637,7 +637,6 @@ enum enum_binlog_format { BINLOG_FORMAT_ROW= 2, ///< row-based BINLOG_FORMAT_UNSPEC=3 ///< thd_binlog_format() returns it when binlog is closed }; -extern TYPELIB binlog_format_typelib; int query_error_code(THD *thd, bool not_killed); uint purge_log_get_error_code(int res); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1a44115d893..7ce27f4ba4f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -294,12 +294,6 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] = {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}, {&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}}; -const char *log_output_names[] = { "NONE", "FILE", "TABLE", NullS}; -static const unsigned int log_output_names_len[]= { 4, 4, 5, 0 }; -TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"", - log_output_names, - (unsigned int *) log_output_names_len}; - /* static variables */ #ifdef HAVE_PSI_INTERFACE @@ -395,8 +389,8 @@ my_bool opt_skip_slave_start = 0; ///< If set, slave is not autostarted my_bool opt_reckless_slave = 0; my_bool opt_enable_named_pipe= 0; my_bool opt_local_infile, opt_slave_compressed_protocol; -my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; -my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; +my_bool opt_safe_user_create = 0; +my_bool opt_show_slave_auth_info; my_bool opt_log_slave_updates= 0; char *opt_slave_skip_errors; @@ -440,9 +434,6 @@ my_bool sp_automatic_privileges= 1; ulong opt_binlog_rows_event_max_size; const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS}; -TYPELIB binlog_format_typelib= - { array_elements(binlog_format_names) - 1, "", - binlog_format_names, NULL }; #ifdef HAVE_INITGROUPS static bool calling_initgroups= FALSE; /**< Used in SIGSEGV handler. */ #endif @@ -458,7 +449,7 @@ ulong thread_created; ulong back_log, connect_timeout, concurrency, server_id; ulong table_cache_size, table_def_size; ulong what_to_log; -ulong query_buff_size, slow_launch_time, slave_open_temp_tables; +ulong slow_launch_time, slave_open_temp_tables; ulong open_files_limit, max_binlog_size, max_relay_log_size; ulong slave_trans_retries; uint slave_net_timeout; @@ -547,7 +538,6 @@ char mysql_real_data_home[FN_REFLEN], mysql_charsets_dir[FN_REFLEN], *opt_init_file, *opt_tc_log_file; char *lc_messages_dir_ptr, *log_error_file_ptr; -char err_shared_dir[FN_REFLEN]; char mysql_unpacked_real_data_home[FN_REFLEN]; int mysql_unpacked_real_data_home_len; uint mysql_real_data_home_len, mysql_data_home_len= 1; @@ -581,7 +571,6 @@ Le_creator le_creator; MYSQL_FILE *bootstrap_file; int bootstrap_error; -FILE *stderror_file=0; I_List<THD> threads; Rpl_filter* rpl_filter; diff --git a/sql/mysqld.h b/sql/mysqld.h index e14cd15ceb8..626c2d116f5 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -78,9 +78,6 @@ 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; -extern TYPELIB log_output_typelib; -extern const char *log_output_names[]; - /** Character set of the buildin error messages loaded from errmsg.sys. */ @@ -105,7 +102,7 @@ extern bool volatile abort_loop; extern bool in_bootstrap; extern uint volatile thread_count, global_read_lock; extern uint connection_count; -extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types; +extern my_bool opt_safe_user_create; extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap; extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern uint slave_exec_mode_options; @@ -173,7 +170,6 @@ extern ulong slave_trans_retries; extern uint slave_net_timeout; 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, open_files_limit; extern ulonglong max_binlog_cache_size; @@ -210,9 +206,7 @@ extern MYSQL_FILE *bootstrap_file; extern my_bool old_mode; extern LEX_STRING opt_init_connect, opt_init_slave; extern int bootstrap_error; -extern FILE *stderror_file; extern I_List<THD> threads; -extern char err_shared_dir[]; extern scheduler_functions thread_scheduler; extern TYPELIB thread_handling_typelib; extern my_decimal decimal_zero; @@ -313,7 +307,6 @@ extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[]; extern char mysql_unpacked_real_data_home[]; extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables; extern char default_logfile_name[FN_REFLEN]; -extern char err_shared_dir[]; #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list)) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 18a5303bf96..47eb2f7031d 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -55,9 +55,6 @@ const char* rpl_status_type[]= "AUTH_MASTER","IDLE_SLAVE","ACTIVE_SLAVE","LOST_SOLDIER","TROOP_SOLDIER", "RECOVERY_CAPTAIN","NULL",NullS }; -TYPELIB rpl_status_typelib= {array_elements(rpl_status_type)-1,"", - rpl_status_type, NULL}; - static Slave_log_event* find_slave_event(IO_CACHE* log, const char* log_file_name, diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h index 94b151aaee7..c6d00de47cb 100644 --- a/sql/repl_failsafe.h +++ b/sql/repl_failsafe.h @@ -30,7 +30,7 @@ extern RPL_STATUS rpl_status; extern mysql_mutex_t LOCK_rpl_status; extern mysql_cond_t COND_rpl_status; -extern TYPELIB rpl_role_typelib, rpl_status_typelib; +extern TYPELIB rpl_role_typelib; extern const char* rpl_role_type[], *rpl_status_type[]; pthread_handler_t handle_failsafe_rpl(void *arg); diff --git a/sql/set_var.h b/sql/set_var.h index 1b415567659..5f1f889c4ce 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -169,7 +169,6 @@ protected: { return ((uchar*)&global_system_variables) + offset; } }; -#include "log.h" /* binlog_format_typelib */ #include "sql_plugin.h" /* SHOW_HA_ROWS, SHOW_MY_BOOL */ /**************************************************************************** diff --git a/sql/slave.cc b/sql/slave.cc index dc0f7286d5c..25860138cf2 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -83,7 +83,6 @@ ulonglong relay_log_space_limit = 0; */ int disconnect_slave_event_count = 0, abort_slave_event_count = 0; -int events_till_abort = -1; static pthread_key(Master_info*, RPL_MASTER_INFO); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index aefddc0b6a5..568640b574a 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -41,7 +41,6 @@ sys_var *trg_new_row_fake_var= (sys_var*) 0x01; LEX_STRING constant for null-string to be used in parser and other places. */ const LEX_STRING null_lex_str= {NULL, 0}; -const LEX_STRING empty_lex_str= { (char*) "", 0 }; /** @note The order of the elements of this array must correspond to the order of elements in enum_binlog_stmt_unsafe. diff --git a/sql/sql_lex.h b/sql/sql_lex.h index b8bf3b220c9..ed521e4791f 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -995,8 +995,6 @@ enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE, XA_SUSPEND, XA_FOR_MIGRATE}; extern const LEX_STRING null_lex_str; -extern const LEX_STRING empty_lex_str; - class Sroutine_hash_entry; diff --git a/sql/sql_priv.h b/sql/sql_priv.h index 604890ffbe5..7067ca084e2 100644 --- a/sql/sql_priv.h +++ b/sql/sql_priv.h @@ -59,8 +59,6 @@ (Old), (New)); \ } while(0) -extern char err_shared_dir[]; - /*************************************************************************/ #endif diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 6e95961ebb0..37a87687d48 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2866,6 +2866,8 @@ static bool fix_log_output(sys_var *self, THD *thd, enum_var_type type) return false; } +static const char *log_output_names[] = { "NONE", "FILE", "TABLE", NULL}; + static Sys_var_set Sys_log_output( "log_output", "Syntax: log-output=value[,value...], " "where \"value\" could be TABLE, FILE or NONE", diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c index baa01a507eb..073b127f1a3 100644 --- a/storage/myisam/mi_static.c +++ b/storage/myisam/mi_static.c @@ -38,7 +38,6 @@ uint myisam_concurrent_insert= 2; uint myisam_concurrent_insert= 0; #endif ulonglong myisam_max_temp_length= MAX_FILE_SIZE; -ulong myisam_bulk_insert_tree_size=8192*1024; ulong myisam_data_pointer_size=4; ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0; diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc index aae8f9dc8c1..823a449e2ac 100644 --- a/storage/perfschema/pfs_events_waits.cc +++ b/storage/perfschema/pfs_events_waits.cc @@ -39,7 +39,6 @@ bool flag_events_waits_summary_by_thread_by_event_name= true; bool flag_events_waits_summary_by_event_name= true; /** Consumer flag for table EVENTS_WAITS_SUMMARY_BY_INSTANCE. */ bool flag_events_waits_summary_by_instance= true; -bool flag_events_locks_summary_by_thread_by_event_name= true; bool flag_events_locks_summary_by_event_name= true; bool flag_events_locks_summary_by_instance= true; /** Consumer flag for table FILE_SUMMARY_BY_EVENT_NAME. */ |