diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-02-10 14:05:49 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-03-16 14:48:22 +0400 |
commit | 18e9c314e43271debf58f3c3e5bf454eab655799 (patch) | |
tree | cd2ff9ea71622f048b609873f4024eabfa965d3d | |
parent | 10554ca6cbb6a02098b0cc1a55fb5426164ef348 (diff) | |
download | mariadb-git-18e9c314e43271debf58f3c3e5bf454eab655799.tar.gz |
MDEV-6650 - LINT_INIT emits code in non-debug builds
Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT.
Removed LINT_INIT macro.
59 files changed, 87 insertions, 214 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index a0fddfb2413..8948cf2158c 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -157,8 +157,8 @@ fi # Set flags for various build configurations. # Used in -valgrind builds # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro -# LINT_INIT(), which is only useful for silencing spurious warnings -# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. +# UNINIT_VAR(), which is only useful for silencing spurious warnings +# of static analysis tools. We want UNINIT_VAR() to be a no-op in Valgrind. valgrind_flags="-DHAVE_valgrind -USAFEMALLOC" valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" diff --git a/client/mysql.cc b/client/mysql.cc index b299ab96b1d..92324c6a073 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3040,9 +3040,7 @@ static int com_server_help(String *buffer __attribute__((unused)), init_pager(); char last_char= 0; - int num_name= 0, num_cat= 0; - LINT_INIT(num_name); - LINT_INIT(num_cat); + int UNINIT_VAR(num_name), UNINIT_VAR(num_cat); if (num_fields == 2) { @@ -3179,7 +3177,7 @@ com_go(String *buffer,char *line __attribute__((unused))) } /* Remove garbage for nicer messages */ - LINT_INIT(buff[0]); + LINT_INIT_STRUCT(buff[0]); remove_cntrl(*buffer); if (buffer->is_empty()) @@ -4698,8 +4696,7 @@ com_status(String *buffer __attribute__((unused)), const char *status_str; char buff[40]; ulonglong id; - MYSQL_RES *result; - LINT_INIT(result); + MYSQL_RES *UNINIT_VAR(result); if (mysql_real_query_for_lazy( C_STRING_WITH_LEN("select DATABASE(), USER() limit 1"))) @@ -5258,8 +5255,7 @@ static void init_username() my_free(full_username); my_free(part_username); - MYSQL_RES *result; - LINT_INIT(result); + MYSQL_RES *UNINIT_VAR(result); if (!mysql_query(&mysql,"select USER()") && (result=mysql_use_result(&mysql))) { diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 5118b024078..5a54c67684b 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -2617,12 +2617,11 @@ void var_query_set(VAR *var, const char *query, const char** query_end) { char *end = (char*)((query_end && *query_end) ? *query_end : query + strlen(query)); - MYSQL_RES *res; + MYSQL_RES *UNINIT_VAR(res); MYSQL_ROW row; MYSQL* mysql = cur_con->mysql; DYNAMIC_STRING ds_query; DBUG_ENTER("var_query_set"); - LINT_INIT(res); if (!mysql) { @@ -2801,7 +2800,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var) { long row_no; int col_no= -1; - MYSQL_RES* res; + MYSQL_RES* UNINIT_VAR(res); MYSQL* mysql= cur_con->mysql; static DYNAMIC_STRING ds_query; @@ -2814,7 +2813,6 @@ void var_set_query_get_value(struct st_command *command, VAR *var) }; DBUG_ENTER("var_set_query_get_value"); - LINT_INIT(res); if (!mysql) { diff --git a/client/readline.cc b/client/readline.cc index b6643b86356..23b1f8d7ac7 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -57,8 +57,7 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file) char *batch_readline(LINE_BUFFER *line_buff, bool binary_mode) { char *pos; - ulong out_length; - LINT_INIT(out_length); + ulong UNINIT_VAR(out_length); if (!(pos=intern_read_line(line_buff, &out_length))) return 0; diff --git a/include/my_global.h b/include/my_global.h index 4a1cc8c5b75..e026f8a66a9 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -457,19 +457,6 @@ extern "C" int madvise(void *addr, size_t len, int behav); #define STDERR_FILENO 2 #endif -/* - Deprecated workaround for false-positive uninitialized variables - warnings. Those should be silenced using tool-specific heuristics. - - Enabled by default for g++ due to the bug referenced below. -*/ -#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \ - (defined(__GNUC__) && defined(__cplusplus)) -#define LINT_INIT(var) var= 0 -#else -#define LINT_INIT(var) -#endif - #ifndef SO_EXT #ifdef _WIN32 #define SO_EXT ".dll" diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index a878b2fae44..caf0309710e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -859,12 +859,11 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild) MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql) { - MYSQL_DATA *fields; + MYSQL_DATA *UNINIT_VAR(fields); uint field_count; uchar *pos; DBUG_ENTER("mysql_list_processes"); - LINT_INIT(fields); if (simple_command(mysql,COM_PROCESS_INFO,0,0,0)) DBUG_RETURN(0); free_old_query(mysql); diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 613911e4495..4cc767f924d 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -315,12 +315,11 @@ inline uint32* find_prev_pc(uint32* pc, uchar** fp) void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) { - uchar** fp; + uchar** UNINIT_VAR(fp); uint frame_count = 0, sigreturn_frame_count; #if defined(__alpha__) && defined(__GNUC__) uint32* pc; #endif - LINT_INIT(fp); #ifdef __i386__ diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 55f81057d03..c88c162be03 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -1050,8 +1050,6 @@ int ReplSemiSyncMaster::readSlaveReply(NET *net, uint32 server_id, ulong trc_level = trace_level_; LINT_INIT_STRUCT(start_ts); - LINT_INIT_STRUCT(start_ts); - function_enter(kWho); assert((unsigned char)event_buf[1] == kPacketMagicNum); diff --git a/sql-common/client.c b/sql-common/client.c index 8d03ffef534..006b17374d0 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -3211,7 +3211,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, uint port, const char *unix_socket,ulong client_flag) { char buff[NAME_LEN+USERNAME_LENGTH+100]; - int scramble_data_len, pkt_scramble_len= 0; + int scramble_data_len, UNINIT_VAR(pkt_scramble_len); char *end,*host_info= 0, *server_version_end, *pkt_end; char *scramble_data; const char *scramble_plugin; @@ -3224,7 +3224,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, struct sockaddr_un UNIXaddr; #endif DBUG_ENTER("mysql_real_connect"); - LINT_INIT(pkt_scramble_len); DBUG_PRINT("enter",("host: %s db: %s user: %s (client)", host ? host : "(Null)", diff --git a/sql/create_options.cc b/sql/create_options.cc index 5800003ed49..86fb805315a 100644 --- a/sql/create_options.cc +++ b/sql/create_options.cc @@ -762,9 +762,8 @@ engine_option_value *merge_engine_table_options(engine_option_value *first, engine_option_value *second, MEM_ROOT *root) { - engine_option_value *end, *opt; + engine_option_value *UNINIT_VAR(end), *opt; DBUG_ENTER("merge_engine_table_options"); - LINT_INIT(end); /* Create copy of first list */ for (opt= first, first= 0; opt; opt= opt->next) diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 5802d726aa2..2ace83ca751 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1348,8 +1348,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) if (action->execute) { - const char *old_proc_info; - LINT_INIT(old_proc_info); + const char *UNINIT_VAR(old_proc_info); action->execute--; diff --git a/sql/derror.cc b/sql/derror.cc index f19f73238fb..7ac068300f9 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -152,13 +152,11 @@ bool read_texts(const char *file_name, const char *language, File file; char name[FN_REFLEN]; char lang_path[FN_REFLEN]; - uchar *buff; + uchar *UNINIT_VAR(buff); uchar head[32],*pos; DBUG_ENTER("read_texts"); *point= 0; - - LINT_INIT(buff); funktpos=0; convert_dirname(lang_path, language, NullS); (void) my_load_path(lang_path, lang_path, lc_messages_dir); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index db4ae3ada46..53b3e96c323 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -414,9 +414,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, CHARSET_INFO *scs= system_charset_info; KEY *key_info; uint key_len; - uchar *key_buf= NULL; - LINT_INIT(key_buf); - + uchar *key_buf; DBUG_ENTER("Event_db_repository::index_read_for_db_for_i_s"); DBUG_PRINT("info", ("Using prefix scanning on PK")); diff --git a/sql/handler.cc b/sql/handler.cc index d64c14689bd..a68f5a7733c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -5418,8 +5418,7 @@ int handler::index_read_idx_map(uchar * buf, uint index, const uchar * key, key_part_map keypart_map, enum ha_rkey_function find_flag) { - int error, error1; - LINT_INIT(error1); + int error, UNINIT_VAR(error1); error= ha_index_init(index, 0); if (!error) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 7a5e13d3cb3..75916456ebd 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -470,8 +470,7 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item, my_bitmap_map *old_maps[2]; ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */ - LINT_INIT(old_maps[0]); - LINT_INIT(old_maps[1]); + LINT_INIT_STRUCT(old_maps); /* table->read_set may not be set if we come here from a CREATE TABLE */ if (table && table->read_set) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 50e29aa4b7c..54fc8d555c8 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1948,8 +1948,7 @@ String *Item_func_ltrim::val_str(String *str) char buff[MAX_FIELD_WIDTH], *ptr, *end; String tmp(buff,sizeof(buff),system_charset_info); String *res, *remove_str; - uint remove_length; - LINT_INIT(remove_length); + uint UNINIT_VAR(remove_length); res= args[0]->val_str(str); if ((null_value=args[0]->null_value)) @@ -1994,8 +1993,7 @@ String *Item_func_rtrim::val_str(String *str) char buff[MAX_FIELD_WIDTH], *ptr, *end; String tmp(buff, sizeof(buff), system_charset_info); String *res, *remove_str; - uint remove_length; - LINT_INIT(remove_length); + uint UNINIT_VAR(remove_length); res= args[0]->val_str(str); if ((null_value=args[0]->null_value)) @@ -2075,8 +2073,7 @@ String *Item_func_trim::val_str(String *str) const char *r_ptr; String tmp(buff, sizeof(buff), system_charset_info); String *res, *remove_str; - uint remove_length; - LINT_INIT(remove_length); + uint UNINIT_VAR(remove_length); res= args[0]->val_str(str); if ((null_value=args[0]->null_value)) diff --git a/sql/key.cc b/sql/key.cc index e3787ea7869..aaecbda57ad 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -656,9 +656,8 @@ int key_tuple_cmp(KEY_PART_INFO *part, uchar *key1, uchar *key2, uint tuple_length) { uchar *key1_end= key1 + tuple_length; - int len; + int UNINIT_VAR(len); int res; - LINT_INIT(len); for (;key1 < key1_end; key1 += len, key2 += len, part++) { len= part->store_length; @@ -709,12 +708,9 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key) for (; key_part < end_key_part; key_part++) { uchar *pos= (uchar*)key; - CHARSET_INFO *cs; - uint length, pack_length; + CHARSET_INFO *UNINIT_VAR(cs); + uint UNINIT_VAR(length), UNINIT_VAR(pack_length); bool is_string= TRUE; - LINT_INIT(cs); - LINT_INIT(length); - LINT_INIT(pack_length); key+= key_part->length; if (key_part->null_bit) @@ -816,13 +812,9 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts, { uchar *pos1= (uchar*)key1; uchar *pos2= (uchar*)key2; - CHARSET_INFO *cs; - uint length1, length2, pack_length; + CHARSET_INFO *UNINIT_VAR(cs); + uint UNINIT_VAR(length1), UNINIT_VAR(length2), UNINIT_VAR(pack_length); bool is_string= TRUE; - LINT_INIT(cs); - LINT_INIT(length1); - LINT_INIT(length2); - LINT_INIT(pack_length); key1+= key_part->length; key2+= key_part->length; diff --git a/sql/log.cc b/sql/log.cc index 94536e49145..43eb8be3a59 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1502,8 +1502,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type) void LOGGER::deactivate_log_handler(THD *thd, uint log_type) { my_bool *tmp_opt= 0; - MYSQL_LOG *file_log; - LINT_INIT(file_log); + MYSQL_LOG *UNINIT_VAR(file_log); switch (log_type) { case QUERY_LOG_SLOW: @@ -4878,8 +4877,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock) char new_name[FN_REFLEN], *new_name_ptr, *old_name, *file_to_open; uint close_flag; bool delay_close= false; - File old_file; - LINT_INIT(old_file); + File UNINIT_VAR(old_file); DBUG_ENTER("MYSQL_BIN_LOG::new_file_impl"); if (!is_open()) @@ -5873,9 +5871,8 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate) bool is_trans_cache= FALSE; bool using_trans= event_info->use_trans_cache(); bool direct= event_info->use_direct_logging(); - ulong prev_binlog_id; + ulong UNINIT_VAR(prev_binlog_id); DBUG_ENTER("MYSQL_BIN_LOG::write(Log_event *)"); - LINT_INIT(prev_binlog_id); if (thd->variables.option_bits & OPTION_GTID_BEGIN) { @@ -7316,10 +7313,9 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader) group_commit_entry *current, *last_in_queue; group_commit_entry *queue= NULL; bool check_purge= false; - ulong binlog_id; + ulong UNINIT_VAR(binlog_id); uint64 commit_id; DBUG_ENTER("MYSQL_BIN_LOG::trx_group_commit_leader"); - LINT_INIT(binlog_id); { DBUG_EXECUTE_IF("inject_binlog_commit_before_get_LOCK_log", @@ -8297,8 +8293,7 @@ int TC_LOG_MMAP::log_and_order(THD *thd, my_xid xid, bool all, { int cookie; struct commit_entry entry; - bool is_group_commit_leader; - LINT_INIT(is_group_commit_leader); + bool UNINIT_VAR(is_group_commit_leader); if (need_prepare_ordered) { @@ -9794,8 +9789,7 @@ binlog_checksum_update(MYSQL_THD thd, struct st_mysql_sys_var *var, { ulong value= *((ulong *)save); bool check_purge= false; - ulong prev_binlog_id; - LINT_INIT(prev_binlog_id); + ulong UNINIT_VAR(prev_binlog_id); mysql_mutex_lock(mysql_bin_log.get_log_lock()); if(mysql_bin_log.is_open()) diff --git a/sql/log_event.cc b/sql/log_event.cc index 7b8bd30f04d..ad9d8f317e6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7063,8 +7063,7 @@ bool Intvar_log_event::write(IO_CACHE* file) void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) { char llbuff[22]; - const char *msg; - LINT_INIT(msg); + const char *UNINIT_VAR(msg); Write_on_release_cache cache(&print_event_info->head_cache, file, Write_on_release_cache::FLUSH_F); @@ -11709,14 +11708,12 @@ record_compare_exit: int Rows_log_event::find_key() { uint i, best_key_nr, last_part; - KEY *key, *best_key; - ulong best_rec_per_key, tmp; + KEY *key, *UNINIT_VAR(best_key); + ulong UNINIT_VAR(best_rec_per_key), tmp; DBUG_ENTER("Rows_log_event::find_key"); DBUG_ASSERT(m_table); best_key_nr= MAX_KEY; - LINT_INIT(best_key); - LINT_INIT(best_rec_per_key); /* Keys are sorted so that any primary key is first, followed by unique keys, diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index 20b1c5d5cc1..61f344d8689 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -817,12 +817,11 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, THD *thd= current_thd; int res; Key_parameters keypar; - uint key_buff_elem_size; + uint UNINIT_VAR(key_buff_elem_size); /* set/used when do_sort_keys==TRUE */ handler *h_idx; Mrr_ordered_rndpos_reader *disk_strategy= NULL; bool do_sort_keys= FALSE; DBUG_ENTER("DsMrr_impl::dsmrr_init"); - LINT_INIT(key_buff_elem_size); /* set/used when do_sort_keys==TRUE */ /* index_merge may invoke a scan on an object for which dsmrr_info[_const] has not been called, so set the owner handler here as well. diff --git a/sql/mysqld.cc b/sql/mysqld.cc index aa85a023228..7b16646f0c9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1540,8 +1540,7 @@ static void close_connections(void) while (select_thread_in_use) { struct timespec abstime; - int error; - LINT_INIT(error); + int UNINIT_VAR(error); DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM @@ -7533,8 +7532,7 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff, enum enum_var_type scope) { Master_info *mi= NULL; - bool tmp; - LINT_INIT(tmp); + bool UNINIT_VAR(tmp); var->type= SHOW_MY_BOOL; var->value= buff; @@ -7561,8 +7559,7 @@ static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff, enum enum_var_type scope) { Master_info *mi= NULL; - longlong tmp; - LINT_INIT(tmp); + longlong UNINIT_VAR(tmp); var->type= SHOW_LONGLONG; var->value= buff; @@ -7588,8 +7585,7 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff, enum enum_var_type scope) { Master_info *mi= NULL; - float tmp; - LINT_INIT(tmp); + float UNINIT_VAR(tmp); var->type= SHOW_CHAR; var->value= buff; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 8f691f4e5dc..4bef42e82bf 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3235,8 +3235,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, { /* Try creating index_merge/ROR-union scan. */ SEL_IMERGE *imerge; - TABLE_READ_PLAN *best_conj_trp= NULL, *new_conj_trp; - LINT_INIT(new_conj_trp); /* no empty index_merge lists possible */ + TABLE_READ_PLAN *best_conj_trp= NULL, + *UNINIT_VAR(new_conj_trp); /* no empty index_merge lists possible */ DBUG_PRINT("info",("No range reads possible," " trying to construct index_merge")); List_iterator_fast<SEL_IMERGE> it(tree->merges); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index e26937441d1..9804254b35f 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -3288,8 +3288,7 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join) { POSITION *pos= join->best_positions + tablenr; JOIN_TAB *s= pos->table; - uint first; - LINT_INIT(first); // Set by every branch except SJ_OPT_NONE which doesn't use it + uint UNINIT_VAR(first); // Set by every branch except SJ_OPT_NONE which doesn't use it if ((handled_tabs & s->table->map) || pos->sj_strategy == SJ_OPT_NONE) { diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 34381b3cfb1..0d26563d45e 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2047,8 +2047,7 @@ bool partition_info::set_up_charset_field_preps() i= 0; while ((field= *(ptr++))) { - uchar *field_buf; - LINT_INIT(field_buf); + uchar *UNINIT_VAR(field_buf); if (!field_is_partition_charset(field)) continue; diff --git a/sql/slave.cc b/sql/slave.cc index 2a852745470..af3288c5c8d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3570,8 +3570,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli, if (slave_trans_retries) { - int temp_err; - LINT_INIT(temp_err); + int UNINIT_VAR(temp_err); if (exec_res && (temp_err= has_temporary_error(thd))) { const char *errmsg; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index e56462768b7..8efeeab01ec 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1695,7 +1695,7 @@ bool sp_head::execute_function(THD *thd, Item **argp, uint argcount, Field *return_value_fld) { - ulonglong binlog_save_options; + ulonglong UNINIT_VAR(binlog_save_options); bool need_binlog_call= FALSE; uint arg_no; sp_rcontext *octx = thd->spcont; @@ -1709,8 +1709,6 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, DBUG_ENTER("sp_head::execute_function"); DBUG_PRINT("info", ("function %s", m_name.str)); - LINT_INIT(binlog_save_options); - /* Check that the function is called with all specified arguments. diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9ab72442dcd..b4c3e5ecafd 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6071,17 +6071,14 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name, List_iterator_fast<Natural_join_column> field_it(*(table_ref->join_columns)); Natural_join_column *nj_col, *curr_nj_col; - Field *found_field; - Query_arena *arena, backup; + Field *UNINIT_VAR(found_field); + Query_arena *UNINIT_VAR(arena), backup; DBUG_ENTER("find_field_in_natural_join"); DBUG_PRINT("enter", ("field name: '%s', ref 0x%lx", name, (ulong) ref)); DBUG_ASSERT(table_ref->is_natural_join && table_ref->join_columns); DBUG_ASSERT(*actual_table == NULL); - LINT_INIT(arena); - LINT_INIT(found_field); - for (nj_col= NULL, curr_nj_col= field_it++; curr_nj_col; curr_nj_col= field_it++) { @@ -6101,7 +6098,6 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name, if (nj_col->view_field) { Item *item; - LINT_INIT(arena); if (register_tree_change) arena= thd->activate_stmt_arena_if_needed(&backup); /* diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b21f2a51a5b..24d75d97ee4 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -331,8 +331,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list, table_map *map) { TABLE *table= insert_table_list->table; - my_bool autoinc_mark; - LINT_INIT(autoinc_mark); + my_bool UNINIT_VAR(autoinc_mark); table->next_number_field_updated= FALSE; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index f603534013f..4e061112128 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1028,7 +1028,7 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd) static int lex_one_token(YYSTYPE *yylval, THD *thd) { - reg1 uchar c; + reg1 uchar UNINIT_VAR(c); bool comment_closed; int tokval, result_state; uint length; @@ -1039,7 +1039,6 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd) const uchar *const state_map= cs->state_map; const uchar *const ident_map= cs->ident_map; - LINT_INIT(c); lip->yylval=yylval; // The global state lip->start_token(); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 30c4416b417..640eee093cc 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7310,11 +7310,10 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, LEX_STRING *option) { register TABLE_LIST *ptr; - TABLE_LIST *previous_table_ref; /* The table preceding the current one. */ + TABLE_LIST *UNINIT_VAR(previous_table_ref); /* The table preceding the current one. */ char *alias_str; LEX *lex= thd->lex; DBUG_ENTER("add_table_to_list"); - LINT_INIT(previous_table_ref); if (!table) DBUG_RETURN(0); // End of memory diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 28febc60fbb..15290b218ac 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3397,7 +3397,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, DYNAMIC_ARRAY *keyuse_array) { int error= 0; - TABLE *table; + TABLE *UNINIT_VAR(table); /* inited in all loops */ uint i,table_count,const_count,key; table_map found_const_table_map, all_table_map, found_ref, refs; key_map const_ref, eq_part; @@ -3412,7 +3412,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, TABLE_LIST *tables; DBUG_ENTER("make_join_statistics"); - LINT_INIT(table); /* inited in all loops */ table_count=join->table_count; /* @@ -12036,13 +12035,12 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, return change_list ? 0 : first_order; // No need to sort ORDER *order,**prev_ptr, *tmp_order; - table_map first_table; + table_map UNINIT_VAR(first_table); /* protected by first_is_base_table */ table_map not_const_tables= ~join->const_table_map; table_map ref; bool first_is_base_table= FALSE; DBUG_ENTER("remove_const"); - LINT_INIT(first_table); /* protected by first_is_base_table */ if (join->join_tab[join->const_tables].table) { first_table= join->join_tab[join->const_tables].table->map; @@ -15468,8 +15466,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, uint convert_blob_length) { bool maybe_null= item->maybe_null; - Field *new_field; - LINT_INIT(new_field); + Field *UNINIT_VAR(new_field); switch (item->result_type()) { case REAL_RESULT: @@ -17462,9 +17459,8 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) { int rc= 0; enum_nested_loop_state error= NESTED_LOOP_OK; - JOIN_TAB *join_tab; + JOIN_TAB *UNINIT_VAR(join_tab); DBUG_ENTER("do_select"); - LINT_INIT(join_tab); join->procedure=procedure; join->tmp_table= table; /* Save for easy recursion */ diff --git a/sql/sql_select.h b/sql/sql_select.h index fb42b6ba08e..dcfb6778ccc 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -762,7 +762,7 @@ public: void set_empty() { sjm_scan_need_tables= 0; - LINT_INIT(sjm_scan_last_inner); + LINT_INIT_STRUCT(sjm_scan_last_inner); is_used= FALSE; } void set_from_prev(struct st_position *prev); diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 4ce1f3ec22a..021e4c37e86 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1551,7 +1551,7 @@ public: uint key_parts= table->actual_n_key_parts(key_info); empty= TRUE; prefixes= 0; - LINT_INIT(calc_state); + LINT_INIT_STRUCT(calc_state); is_single_comp_pk= FALSE; uint pk= table->s->primary_key; diff --git a/sql/sql_time.cc b/sql/sql_time.cc index ca689d55a2b..267b183562b 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -545,8 +545,7 @@ bool parse_date_time_format(timestamp_type format_type, { if (*ptr == '%' && ptr+1 != end) { - uint position; - LINT_INIT(position); + uint UNINIT_VAR(position); switch (*++ptr) { case 'y': // Year case 'Y': diff --git a/sql/table.cc b/sql/table.cc index f8e9a424bf9..5c85d5668ed 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4826,9 +4826,8 @@ bool TABLE_LIST::is_leaf_for_name_resolution() TABLE_LIST *TABLE_LIST::first_leaf_for_name_resolution() { - TABLE_LIST *cur_table_ref; + TABLE_LIST *UNINIT_VAR(cur_table_ref); NESTED_JOIN *cur_nested_join; - LINT_INIT(cur_table_ref); if (is_leaf_for_name_resolution()) return this; @@ -5547,10 +5546,9 @@ Field_iterator_table_ref::get_or_create_column_ref(THD *thd, TABLE_LIST *parent_ { Natural_join_column *nj_col; bool is_created= TRUE; - uint field_count; + uint UNINIT_VAR(field_count); TABLE_LIST *add_table_ref= parent_table_ref ? parent_table_ref : table_ref; - LINT_INIT(field_count); if (field_it == &table_field_it) { diff --git a/sql/tztime.cc b/sql/tztime.cc index 1cb1f5a0d5c..9fa065eefa0 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -327,7 +327,7 @@ static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) { my_time_t cur_t= MY_TIME_T_MIN; - my_time_t cur_l, end_t, end_l; + my_time_t cur_l, end_t, UNINIT_VAR(end_l); my_time_t cur_max_seen_l= MY_TIME_T_MIN; long cur_offset, cur_corr, cur_off_and_corr; uint next_trans_idx, next_leap_idx; @@ -340,8 +340,6 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) my_time_t revts[TZ_MAX_REV_RANGES]; REVT_INFO revtis[TZ_MAX_REV_RANGES]; - LINT_INIT(end_l); - /* Let us setup fallback time type which will be used if we have not any transitions or if we have moment of time before first transition. diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index d9d4564fc99..7c144ac52a4 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -1721,11 +1721,10 @@ static my_bool find_blob(MARIA_HA *info, ulong length) uint full_page_size= FULL_PAGE_SIZE(info->s); ulong pages; uint rest_length, used; - uint first_block_pos; + uint UNINIT_VAR(first_block_pos); MARIA_BITMAP_BLOCK *first_block= 0; DBUG_ENTER("find_blob"); DBUG_PRINT("enter", ("length: %lu", length)); - LINT_INIT(first_block_pos); pages= length / full_page_size; rest_length= (uint) (length - pages * full_page_size); diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index e582f0e166e..8c012d21095 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -1862,8 +1862,6 @@ static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend, page_type, bitmap_pattern; uint bitmap_for_page; - LINT_INIT(empty_space); - if (_ma_killed_ptr(param)) { _ma_scan_end_block_record(info); diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c index 9fed9dbe8da..eb6352b7a87 100644 --- a/storage/maria/ma_dynrec.c +++ b/storage/maria/ma_dynrec.c @@ -1593,9 +1593,8 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info, uchar *buffer; MARIA_BLOCK_INFO block_info; my_bool error= 1; - size_t buffer_length; + size_t UNINIT_VAR(buffer_length); DBUG_ENTER("_ma_cmp_dynamic_record"); - LINT_INIT(buffer_length); if (info->opt_flag & WRITE_CACHE_USED) { diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c index 613f13e64a9..5eb916112d7 100644 --- a/storage/maria/ma_ft_nlq_search.c +++ b/storage/maria/ma_ft_nlq_search.c @@ -83,8 +83,6 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) #error #endif DBUG_ENTER("walk_and_match"); - LINT_INIT(subkeys.i); - LINT_INIT_STRUCT(subkeys); word->weight=LWS_FOR_QUERY; diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index c83ad70914e..271a0ee8d53 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -280,7 +280,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN], data_name[FN_REFLEN]; uchar *disk_cache, *disk_pos, *end_pos; - MARIA_HA info,*m_info,*old_info; + MARIA_HA info, *UNINIT_VAR(m_info), *old_info; MARIA_SHARE share_buff,*share; double *rec_per_key_part; ulong *nulls_per_key_part; @@ -290,7 +290,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) File data_file= -1; DBUG_ENTER("maria_open"); - LINT_INIT(m_info); kfile= -1; errpos= 0; head_length=sizeof(share_buff.state.header); diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index eeb87d2b7a0..8315c3136c5 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -3370,8 +3370,7 @@ restart: /* Key cache is used */ PAGECACHE_BLOCK_LINK *block; uint status; - int page_st; - LINT_INIT(page_st); + int UNINIT_VAR(page_st); pagecache_pthread_mutex_lock(&pagecache->cache_lock); if (!pagecache->can_be_used) diff --git a/storage/maria/ma_range.c b/storage/maria/ma_range.c index 7747df6415a..7216480abd9 100644 --- a/storage/maria/ma_range.c +++ b/storage/maria/ma_range.c @@ -209,14 +209,13 @@ static double _ma_search_pos(MARIA_HA *info, MARIA_KEY *key, uint32 nextflag, my_off_t pos) { int flag; - uint keynr, max_keynr; + uint keynr, UNINIT_VAR(max_keynr); my_bool after_key; uchar *keypos; double offset; MARIA_KEYDEF *keyinfo= key->keyinfo; MARIA_PAGE page; DBUG_ENTER("_ma_search_pos"); - LINT_INIT(max_keynr); if (pos == HA_OFFSET_ERROR) DBUG_RETURN(0.0); diff --git a/storage/maria/ma_rt_index.c b/storage/maria/ma_rt_index.c index 0d187c81692..320418c15ed 100644 --- a/storage/maria/ma_rt_index.c +++ b/storage/maria/ma_rt_index.c @@ -523,19 +523,15 @@ static const uchar *maria_rtree_pick_key(const MARIA_KEY *key, const MARIA_PAGE *page) { double increase; - double best_incr; + double UNINIT_VAR(best_incr); double perimeter; - double best_perimeter; + double UNINIT_VAR(best_perimeter); uchar *best_key= NULL; const MARIA_HA *info= page->info; uchar *k= rt_PAGE_FIRST_KEY(info->s, page->buf, page->node); uchar *last= rt_PAGE_END(info, page); - LINT_INIT(best_perimeter); - LINT_INIT(best_key); - LINT_INIT(best_incr); - for (; k < last; k= rt_PAGE_NEXT_KEY(k, key->data_length, nod_flag)) { if ((increase= maria_rtree_perimeter_increase(keyinfo->seg, k, key, @@ -563,13 +559,11 @@ static const uchar *maria_rtree_pick_key(const MARIA_KEY *key, double increase; double best_incr= DBL_MAX; double area; - double best_area; + double UNINIT_VAR(best_area); const uchar *best_key= NULL; const uchar *k= rt_PAGE_FIRST_KEY(share, page->buff, page->node); const uchar *last= rt_PAGE_END(page); - LINT_INIT(best_area); - for (; k < last; k= rt_PAGE_NEXT_KEY(share, k, key->data_length, page->node)) { diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c index d38bc7af26c..14ff084332e 100644 --- a/storage/maria/ma_search.c +++ b/storage/maria/ma_search.c @@ -269,7 +269,7 @@ int _ma_bin_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, uint32 comp_flag, uchar **ret_pos, uchar *buff __attribute__((unused)), my_bool *last_key) { - int flag; + int UNINIT_VAR(flag); uint page_flag; uint start, mid, end, save_end, totlength, nod_flag; uint not_used[2]; @@ -278,8 +278,6 @@ int _ma_bin_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, uchar *page; DBUG_ENTER("_ma_bin_search"); - LINT_INIT(flag); - page_flag= ma_page->flag; if (page_flag & KEYPAGE_FLAG_HAS_TRANSID) { diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index 421dc8392e3..d511c1e6c97 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -110,7 +110,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, uint sort_length, maxbuffer; size_t memavl, old_memavl; DYNAMIC_ARRAY buffpek; - ha_rows records, keys; + ha_rows records, UNINIT_VAR(keys); uchar **sort_keys; IO_CACHE tempfile, tempfile_for_exceptions; DBUG_ENTER("_ma_create_index_by_sort"); @@ -140,7 +140,6 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, memavl=MY_MAX(sortbuff_size,MIN_SORT_MEMORY); records= info->sort_info->max_records; sort_length= info->key_length; - LINT_INIT(keys); while (memavl >= MIN_SORT_MEMORY) { @@ -363,13 +362,11 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg) int error; size_t memavl, old_memavl; longlong sortbuff_size; - ha_keys keys, idx; + ha_keys UNINIT_VAR(keys), idx; uint sort_length; uint maxbuffer; uchar **sort_keys=0; - LINT_INIT(keys); - error=1; if (my_thread_init()) @@ -1029,7 +1026,6 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, count= 0; maxcount= keys/((uint) (Tb-Fb) +1); DBUG_ASSERT(maxcount > 0); - LINT_INIT(to_start_filepos); if (to_file) to_start_filepos=my_b_tell(to_file); strpos= (uchar*) sort_keys; diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c index e0e804ca655..4385f2d306c 100644 --- a/storage/maria/ma_update.c +++ b/storage/maria/ma_update.c @@ -26,14 +26,12 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec) int flag,key_changed,save_errno; reg3 my_off_t pos; uint i; - uchar old_key_buff[MARIA_MAX_KEY_BUFF],*new_key_buff; + uchar old_key_buff[MARIA_MAX_KEY_BUFF], *UNINIT_VAR(new_key_buff); my_bool auto_key_changed= 0; - ulonglong changed; + ulonglong UNINIT_VAR(changed); MARIA_SHARE *share= info->s; MARIA_KEYDEF *keyinfo; DBUG_ENTER("maria_update"); - LINT_INIT(new_key_buff); - LINT_INIT(changed); DBUG_EXECUTE_IF("maria_pretend_crashed_table_on_usage", maria_print_error(info->s, HA_ERR_CRASHED); diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index bab07a48fde..328f5674aef 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -977,7 +977,7 @@ int _ma_split_page(MARIA_HA *info, MARIA_KEY *key, MARIA_PAGE *split_page, uint keynr; uint length,a_length,key_ref_length,t_length,nod_flag,key_length; uint page_length, split_length, page_flag; - uchar *key_pos,*pos, *after_key; + uchar *key_pos, *pos, *UNINIT_VAR(after_key); MARIA_KEY_PARAM s_temp; MARIA_PINNED_PAGE tmp_page_link, *page_link= &tmp_page_link; MARIA_SHARE *share= info->s; @@ -987,7 +987,6 @@ int _ma_split_page(MARIA_HA *info, MARIA_KEY *key, MARIA_PAGE *split_page, int res; DBUG_ENTER("_ma_split_page"); - LINT_INIT(after_key); DBUG_DUMP("buff", split_page->buff, split_page->size); info->page_changed=1; /* Info->buff is used */ diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index b79d6c891f1..be0b90b4bad 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -3292,7 +3292,6 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) } } case DYNAMIC_RECORD: - LINT_INIT(to); pos=sort_param->pos; searching=(sort_param->fix_datafile && (param->testflag & T_EXTEND)); parallel_flag= (sort_param->read_cache.file < 0) ? READING_NEXT : 0; diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c index 3fffa55341b..6a023f35b88 100644 --- a/storage/myisam/mi_delete.c +++ b/storage/myisam/mi_delete.c @@ -305,7 +305,6 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, } } leaf_buff=0; - LINT_INIT(leaf_page); if (nod_flag) { leaf_page=_mi_kpos(nod_flag,keypos); diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 060017f10ad..b8cbefe6ac2 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -721,7 +721,6 @@ uchar *mi_alloc_rec_buff(MI_INFO *info, ulong length, uchar **buf) { uint extra; uint32 UNINIT_VAR(old_length); - LINT_INIT(old_length); if (! *buf || length > (old_length=mi_get_rec_buff_len(info, *buf))) { diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index d1ad911d334..3687cfc2179 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -1364,7 +1364,6 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff, { uchar *header=info->header; uint head_length, UNINIT_VAR(ref_length); - LINT_INIT(ref_length); if (file >= 0) { diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 3ce112f7906..60a34c641ad 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -187,11 +187,10 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, uchar *buff __attribute__((unused)), my_bool *last_key) { reg4 int start,mid,end,save_end; - int flag; + int UNINIT_VAR(flag); uint totlength,nod_flag,not_used[2]; DBUG_ENTER("_mi_bin_search"); - LINT_INIT(flag); totlength=keyinfo->keylength+(nod_flag=mi_test_if_nod(page)); start=0; mid=1; save_end=end=(int) ((mi_getint(page)-2-nod_flag)/totlength-1); diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index 2b922bbaa9e..ff96ee8751b 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -595,11 +595,10 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo, my_bool insert_last_key) { uint length,a_length,key_ref_length,t_length,nod_flag,key_length; - uchar *key_pos,*pos, *after_key; + uchar *key_pos,*pos, *UNINIT_VAR(after_key); my_off_t new_pos; MI_KEY_PARAM s_temp; DBUG_ENTER("mi_split_page"); - LINT_INIT(after_key); DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff)); if (info->s->keyinfo+info->lastinx == keyinfo) @@ -710,13 +709,11 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint *return_key_length, uchar **after_key) { - uint keys,length,last_length,key_ref_length; + uint keys, length, UNINIT_VAR(last_length), key_ref_length; uchar *end,*lastpos,*prevpos; uchar key_buff[HA_MAX_KEY_BUFF]; DBUG_ENTER("_mi_find_last_pos"); - LINT_INIT(last_length); - key_ref_length=2; length=mi_getint(page)-key_ref_length; page+=key_ref_length; diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c index fc0c0345f5e..b3b7fd0e37f 100644 --- a/storage/myisam/rt_index.c +++ b/storage/myisam/rt_index.c @@ -469,14 +469,11 @@ static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, double increase; double best_incr = DBL_MAX; double perimeter; - double best_perimeter; - uchar *best_key; + double UNINIT_VAR(best_perimeter); + uchar *UNINIT_VAR(best_key); uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); uchar *last = rt_PAGE_END(page_buf); - LINT_INIT(best_perimeter); - LINT_INIT(best_key); - for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag)) { if ((increase = rtree_perimeter_increase(keyinfo->seg, k, key, key_length, diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 8e45ca1a3ea..f65d1e8fe58 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -107,7 +107,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, uint sort_length, maxbuffer; ulonglong memavl, old_memavl; DYNAMIC_ARRAY buffpek; - ha_rows records, keys; + ha_rows records, UNINIT_VAR(keys); uchar **sort_keys; IO_CACHE tempfile, tempfile_for_exceptions; DBUG_ENTER("_create_index_by_sort"); @@ -135,7 +135,6 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, memavl= MY_MAX(sortbuff_size, MIN_SORT_BUFFER); records= info->sort_info->max_records; sort_length= info->key_length; - LINT_INIT(keys); while (memavl >= MIN_SORT_BUFFER) { @@ -342,13 +341,11 @@ pthread_handler_t thr_find_all_keys(void *arg) MI_SORT_PARAM *sort_param= (MI_SORT_PARAM*) arg; int error; ulonglong memavl, old_memavl, sortbuff_size; - ha_keys keys, idx; + ha_keys UNINIT_VAR(keys), idx; uint sort_length; uint maxbuffer; uchar **sort_keys=0; - LINT_INIT(keys); - error=1; if (my_thread_init()) @@ -552,7 +549,6 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) MI_SORT_PARAM *sinfo; uchar *mergebuf=0; DBUG_ENTER("thr_write_keys"); - LINT_INIT(length); for (i= 0, sinfo= sort_param ; i < sort_info->total_keys ; @@ -977,7 +973,6 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, count=error=0; maxcount= keys/((uint) (Tb-Fb) +1); DBUG_ASSERT(maxcount > 0); - LINT_INIT(to_start_filepos); if (to_file) to_start_filepos=my_b_tell(to_file); strpos=(uchar*) sort_keys; diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index c4a6857fe07..7f3937f572d 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -239,7 +239,6 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, rc= 1; errpos= 0; bzero((char*) &file_cache, sizeof(file_cache)); - LINT_INIT(m_info); /* Open MERGE meta file. */ if ((fd= mysql_file_open(rg_key_file_MRG, diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index c875af1488b..71ddf89a55f 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -4064,7 +4064,7 @@ bool ha_tokudb::key_changed(uint keynr, const uchar * old_row, const uchar * new int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { TOKUDB_HANDLER_DBUG_ENTER(""); DBT prim_key, old_prim_key, prim_row, old_prim_row; - int error; + int UNINIT_VAR(error); bool has_null; THD* thd = ha_thd(); DB_TXN* sub_trans = NULL; @@ -4072,7 +4072,6 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); uint curr_num_DBs; - LINT_INIT(error); memset((void *) &prim_key, 0, sizeof(prim_key)); memset((void *) &old_prim_key, 0, sizeof(old_prim_key)); memset((void *) &prim_row, 0, sizeof(prim_row)); diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 56824aac59e..20719783edd 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4629,14 +4629,13 @@ my_strnxfrm_unicode(CHARSET_INFO *cs, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) { - my_wc_t wc; + my_wc_t UNINIT_VAR(wc); int res; uchar *dst0= dst; uchar *de= dst + dstlen; const uchar *se= src + srclen; MY_UNICASE_INFO *uni_plane= (cs->state & MY_CS_BINSORT) ? NULL : cs->caseinfo; - LINT_INIT(wc); DBUG_ASSERT(!srclen || src); for (; dst < de && nweights; nweights--) @@ -4683,12 +4682,11 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) { - my_wc_t wc; + my_wc_t UNINIT_VAR(wc); uchar *dst0= dst; uchar *de= dst + dstlen; const uchar *se = src + srclen; - LINT_INIT(wc); DBUG_ASSERT(!srclen || src); DBUG_ASSERT(cs->state & MY_CS_BINSORT); @@ -7764,12 +7762,10 @@ my_strnncoll_utf8mb4(CHARSET_INFO *cs, const uchar *t, size_t tlen, my_bool t_is_prefix) { - my_wc_t s_wc,t_wc; + my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen; const uchar *te= t + tlen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; - LINT_INIT(s_wc); - LINT_INIT(t_wc); while ( s < se && t < te ) { @@ -7832,11 +7828,9 @@ my_strnncollsp_utf8mb4(CHARSET_INFO *cs, my_bool diff_if_only_endspace_difference) { int res; - my_wc_t s_wc, t_wc; + my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen, *te= t + tlen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; - LINT_INIT(s_wc); - LINT_INIT(t_wc); #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE diff_if_only_endspace_difference= FALSE; |