diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/filesort.cc | 2 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 10 | ||||
-rw-r--r-- | sql/ha_berkeley.h | 8 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 9 | ||||
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/sql_acl.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 1 | ||||
-rw-r--r-- | sql/sql_insert.cc | 1 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 1 | ||||
-rw-r--r-- | sql/sql_select.cc | 4 | ||||
-rw-r--r-- | sql/sql_show.cc | 7 | ||||
-rw-r--r-- | sql/udf_example.def | 1 | ||||
-rw-r--r-- | sql/unireg.cc | 3 |
15 files changed, 37 insertions, 20 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 93fa566349c..e40c492fe8e 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -98,7 +98,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, uint maxbuffer; BUFFPEK *buffpek; ha_rows records= HA_POS_ERROR; - uchar **sort_keys; + uchar **sort_keys= 0; IO_CACHE tempfile, buffpek_pointers, *selected_records_file, *outfile; SORTPARAM param; bool multi_byte_charset; diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index d63935f1a9c..e78808e3308 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -233,6 +233,7 @@ static int berkeley_close_connection(THD *thd) return 0; } + bool berkeley_flush_logs() { int error; @@ -439,6 +440,15 @@ ulong ha_berkeley::index_flags(uint idx, uint part, bool all_parts) const } +void ha_berkeley::get_auto_primary_key(byte *to) +{ + pthread_mutex_lock(&share->mutex); + share->auto_ident++; + int5store(to,share->auto_ident); + pthread_mutex_unlock(&share->mutex); +} + + static int berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key) { diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 051990b0ee5..336c90f009a 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -141,13 +141,7 @@ class ha_berkeley: public handler enum thr_lock_type lock_type); void get_status(); - inline void get_auto_primary_key(byte *to) - { - pthread_mutex_lock(&share->mutex); - share->auto_ident++; - int5store(to,share->auto_ident); - pthread_mutex_unlock(&share->mutex); - } + void get_auto_primary_key(byte *to); ulonglong get_auto_increment(); void print_error(int error, myf errflag); uint8 table_cache_type() { return HA_CACHE_TBL_TRANSACT; } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index d854c362df8..8a35ff000a8 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2711,7 +2711,8 @@ ha_innobase::store_key_val_for_row( true_len = (ulint) cs->cset->well_formed_len(cs, (const char *) data, (const char *) data + len, - key_len / cs->mbmaxlen, + (uint) (key_len / + cs->mbmaxlen), &error); } @@ -2780,7 +2781,8 @@ ha_innobase::store_key_val_for_row( (const char *) blob_data, (const char *) blob_data + blob_len, - key_len / cs->mbmaxlen, + (uint) (key_len / + cs->mbmaxlen), &error); } @@ -2852,7 +2854,8 @@ ha_innobase::store_key_val_for_row( (const char *)src_start, (const char *)src_start + key_len, - key_len / cs->mbmaxlen, + (uint) (key_len / + cs->mbmaxlen), &error); } } diff --git a/sql/item.cc b/sql/item.cc index 205ae49a3cb..4c346070f10 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1521,6 +1521,8 @@ bool agg_item_charsets(DTCollation &coll, const char *fname, doesn't display each argument's characteristics. - if nargs is 1, then this error cannot happen. */ + LINT_INIT(safe_args[0]); + LINT_INIT(safe_args[1]); if (nargs >=2 && nargs <= 3) { safe_args[0]= args[0]; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 8b4e93fa085..683cd8803d6 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1608,7 +1608,7 @@ int Item_func_now::save_in_field(Field *to, bool no_conversions) void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time) { THD *thd= current_thd; - thd->variables.time_zone->gmt_sec_to_TIME(now_time, time(NULL)); + thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) time(NULL)); thd->time_zone_used= 1; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fe3ba1c6d5a..74aad27d0fe 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -324,6 +324,7 @@ static I_List<THD> thread_cache; #ifndef EMBEDDED_LIBRARY static struct passwd *user_info; static pthread_t select_thread; +static uint thr_kill_signal; #endif static pthread_cond_t COND_thread_cache, COND_flush_thread_cache; @@ -522,7 +523,6 @@ rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; pthread_cond_t COND_refresh,COND_thread_count, COND_global_read_lock; pthread_t signal_thread; pthread_attr_t connection_attrib; -static uint thr_kill_signal; File_parser_dummy_hook file_parser_dummy_hook; @@ -3216,7 +3216,7 @@ server."); #ifdef HAVE_REPLICATION if (opt_bin_log && expire_logs_days) { - long purge_time= time(0) - expire_logs_days*24*60*60; + long purge_time= (long) (time(0) - expire_logs_days*24*60*60); if (purge_time >= 0) mysql_bin_log.purge_logs_before_date(purge_time); } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 39a38f3c44e..298fb61d5f0 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -5021,6 +5021,8 @@ static int handle_grant_struct(uint struct_no, bool drop, user= grant_name->user; host= grant_name->host.hostname; break; + default: + assert(0); } if (! user) user= ""; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index ad9cd5985d1..767b955252c 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2975,6 +2975,7 @@ 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 aa429f9250e..3e7c3d15e78 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -410,6 +410,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, #ifndef EMBEDDED_LIBRARY if (lock_type == TL_WRITE_DELAYED) { + res= 1; if (thd->locked_tables) { DBUG_ASSERT(table_list->db); /* Must be set in the parser */ diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ccf70444385..774b82ce618 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2015,6 +2015,7 @@ void mysql_sql_stmt_prepare(THD *thd) uint query_len; DBUG_ENTER("mysql_sql_stmt_prepare"); DBUG_ASSERT(thd->protocol == &thd->protocol_simple); + LINT_INIT(query_len); if ((stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name))) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bbb76616733..63c8ddad3ae 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8081,7 +8081,7 @@ static uint build_bitmap_for_nested_joins(List<TABLE_LIST> *join_list, */ if (nested_join->join_list.elements != 1) { - nested_join->nj_map= 1 << first_unused++; + nested_join->nj_map= (nested_join_map) 1 << first_unused++; first_unused= build_bitmap_for_nested_joins(&nested_join->join_list, first_unused); } @@ -10056,6 +10056,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) enum_nested_loop_state error= NESTED_LOOP_OK; JOIN_TAB *join_tab; DBUG_ENTER("do_select"); + LINT_INIT(join_tab); join->procedure=procedure; join->tmp_table= table; /* Save for easy recursion */ @@ -10100,7 +10101,6 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) else { DBUG_ASSERT(join->tables); - DBUG_ASSERT(join_tab); error= sub_select(join,join_tab,0); if (error == NESTED_LOOP_OK || error == NESTED_LOOP_NO_MORE_ROWS) error= sub_select(join,join_tab,1); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c2b2c77fbda..c4b06934fc3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2515,20 +2515,21 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables, if (file->create_time) { thd->variables.time_zone->gmt_sec_to_TIME(&time, - file->create_time); + (my_time_t) file->create_time); table->field[14]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); table->field[14]->set_notnull(); } if (file->update_time) { thd->variables.time_zone->gmt_sec_to_TIME(&time, - file->update_time); + (my_time_t) file->update_time); table->field[15]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); table->field[15]->set_notnull(); } if (file->check_time) { - thd->variables.time_zone->gmt_sec_to_TIME(&time, file->check_time); + thd->variables.time_zone->gmt_sec_to_TIME(&time, + (my_time_t) file->check_time); table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); table->field[16]->set_notnull(); } diff --git a/sql/udf_example.def b/sql/udf_example.def index ee107d58e51..7a87147d7b6 100644 --- a/sql/udf_example.def +++ b/sql/udf_example.def @@ -1,5 +1,4 @@ LIBRARY udf_example -DESCRIPTION 'MySQL Sample for UDF' VERSION 1.0 EXPORTS lookup diff --git a/sql/unireg.cc b/sql/unireg.cc index 033daa20524..06b2e0c10a2 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -839,7 +839,10 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, field->field_name, &table); if (!regfield) + { + error= 1; goto err; // End of memory + } if (!(field->flags & NOT_NULL_FLAG)) { |