diff options
author | Michael Widenius <monty@mysql.com> | 2010-11-30 01:27:14 +0200 |
---|---|---|
committer | Michael Widenius <monty@mysql.com> | 2010-11-30 01:27:14 +0200 |
commit | ab5e4eefd5d25c6e0755c2460dbb433a7a9e913b (patch) | |
tree | 8d6392c56d26a7b695359d1a974b3093dd5b3467 | |
parent | b9589e2ed717b60152428f743f11e9063cae3e02 (diff) | |
download | mariadb-git-ab5e4eefd5d25c6e0755c2460dbb433a7a9e913b.tar.gz |
Fixed some compiler warnings found when compiling for windows.
Changed rows_read and rows_sent status variables to be longlong (to avoid compiler warnings)
sql/item_func.cc:
Fixed wrong usage of alias
sql/item_subselect.cc:
Changed buffer size to ulonglong to be able detect buffers bigger than size_t
sql/item_subselect.h:
Changed buffer size to ulonglong to be able detect buffers bigger than size_t
sql/multi_range_read.cc:
Fixed compiler warning by using correct type for function argument
sql/mysqld.cc:
Changed rows_read and rows_sent status variables to be longlong
sql/opt_subselect.h:
Fixed compiler warning by using correct type for function argument
sql/sql_class.cc:
Changed rows_read and rows_sent status variables to be longlong
sql/sql_class.h:
Changed rows_read and rows_sent status variables to be longlong
Changed max_nulls_in_row to uint as this is number of columns in row.
This fixed some compiler warnings.
sql/sql_select.cc:
Added casts to avoid compiler warnings
storage/heap/ha_heap.cc:
Initilize different types separate
storage/oqgraph/ha_oqgraph.cc:
Fixed argument to store(longlong) to avoid compiler warnings
-rw-r--r-- | sql/item_func.cc | 2 | ||||
-rw-r--r-- | sql/item_subselect.cc | 7 | ||||
-rw-r--r-- | sql/item_subselect.h | 6 | ||||
-rw-r--r-- | sql/multi_range_read.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/opt_subselect.h | 3 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.h | 8 | ||||
-rw-r--r-- | sql/sql_select.cc | 14 | ||||
-rw-r--r-- | storage/heap/ha_heap.cc | 5 | ||||
-rw-r--r-- | storage/oqgraph/ha_oqgraph.cc | 8 |
11 files changed, 35 insertions, 26 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 872cdf0185b..289de74bf44 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5786,7 +5786,7 @@ Item_func_sp::cleanup() sp_result_field= NULL; } m_sp= NULL; - dummy_table->alias= NULL; + dummy_table->alias.free(); Item_func::cleanup(); } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 8a17ce73556..c9d82ce4421 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -3651,7 +3651,7 @@ subselect_hash_sj_engine::choose_partial_match_strategy( bool has_non_null_key, bool has_covering_null_row, MY_BITMAP *partial_match_key_parts) { - size_t pm_buff_size; + ulonglong pm_buff_size; DBUG_ASSERT(strategy == PARTIAL_MATCH); /* @@ -3716,11 +3716,12 @@ subselect_hash_sj_engine::choose_partial_match_strategy( matching via merging is not applicable. */ -size_t subselect_hash_sj_engine::rowid_merge_buff_size( +ulonglong subselect_hash_sj_engine::rowid_merge_buff_size( bool has_non_null_key, bool has_covering_null_row, MY_BITMAP *partial_match_key_parts) { - size_t buff_size; /* Total size of all buffers used by partial matching. */ + /* Total size of all buffers used by partial matching. */ + ulonglong buff_size; ha_rows row_count= tmp_table->file->stats.records; uint rowid_length= tmp_table->file->ref_length; select_materialize_with_stats *result_sink= diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 320c57b679f..25e42487708 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -800,9 +800,9 @@ protected: protected: exec_strategy get_strategy_using_schema(); exec_strategy get_strategy_using_data(); - size_t rowid_merge_buff_size(bool has_non_null_key, - bool has_covering_null_row, - MY_BITMAP *partial_match_key_parts); + ulonglong rowid_merge_buff_size(bool has_non_null_key, + bool has_covering_null_row, + MY_BITMAP *partial_match_key_parts); void choose_partial_match_strategy(bool has_non_null_key, bool has_covering_null_row, MY_BITMAP *partial_match_key_parts); diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index 53699c47688..ef6d8e0cc68 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -820,7 +820,7 @@ bool DsMrr_impl::get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags, cost->mem_cost= (double)rows_in_last_step * elem_size; /* Total cost of all index accesses */ - index_read_cost= h->keyread_time(keynr, 1, (double)rows); + index_read_cost= h->keyread_time(keynr, 1, rows); cost->add_io(index_read_cost, 1 /* Random seeks */); return FALSE; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index daf2e236601..83b64621786 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8086,8 +8086,8 @@ SHOW_VAR status_vars[]= { {"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS}, {"Opened_table_definitions", (char*) offsetof(STATUS_VAR, opened_shares), SHOW_LONG_STATUS}, {"Prepared_stmt_count", (char*) &show_prepared_stmt_count, SHOW_FUNC}, - {"Rows_sent", (char*) offsetof(STATUS_VAR, rows_sent), SHOW_LONG_STATUS}, - {"Rows_read", (char*) offsetof(STATUS_VAR, rows_read), SHOW_LONG_STATUS}, + {"Rows_sent", (char*) offsetof(STATUS_VAR, rows_sent), SHOW_LONGLONG_STATUS}, + {"Rows_read", (char*) offsetof(STATUS_VAR, rows_read), SHOW_LONGLONG_STATUS}, #ifdef HAVE_QUERY_CACHE {"Qcache_free_blocks", (char*) &query_cache.free_memory_blocks, SHOW_LONG_NOFLUSH}, {"Qcache_free_memory", (char*) &query_cache.free_memory, SHOW_LONG_NOFLUSH}, diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h index d0206b0fd05..47d85d5c38d 100644 --- a/sql/opt_subselect.h +++ b/sql/opt_subselect.h @@ -199,7 +199,8 @@ public: double records= rows2double(s->table->file->stats.records); /* The cost is entire index scan cost (divided by 2) */ - double read_time= s->table->file->keyread_time(key, 1, records); + double read_time= s->table->file->keyread_time(key, 1, + (ha_rows) records); /* Now find out how many different keys we will get (for now we diff --git a/sql/sql_class.cc b/sql/sql_class.cc index a832deccd57..3acb2db9aa6 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1189,6 +1189,8 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) /* Handle the not ulong variables. See end of system_status_var */ to_var->bytes_received= from_var->bytes_received; to_var->bytes_sent+= from_var->bytes_sent; + to_var->rows_read+= from_var->rows_read; + to_var->rows_sent+= from_var->rows_sent; to_var->binlog_bytes_written= from_var->binlog_bytes_written; to_var->cpu_time+= from_var->cpu_time; to_var->busy_time+= from_var->busy_time; diff --git a/sql/sql_class.h b/sql/sql_class.h index 040f5b5a298..334597d8e96 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -557,8 +557,6 @@ typedef struct system_status_var ulong select_range_count; ulong select_range_check_count; ulong select_scan_count; - ulong rows_read; - ulong rows_sent; ulong long_query_count; ulong filesort_merge_passes; ulong filesort_range_count; @@ -588,6 +586,8 @@ typedef struct system_status_var ulonglong bytes_received; ulonglong bytes_sent; ulonglong binlog_bytes_written; + ulonglong rows_read; + ulonglong rows_sent; double last_query_cost; double cpu_time, busy_time; } STATUS_VAR; @@ -3042,7 +3042,7 @@ protected: The number of columns in the biggest sub-row that consists of only NULL values. */ - ha_rows max_nulls_in_row; + uint max_nulls_in_row; /* Count of rows writtent to the temp table. This is redundant as it is already stored in handler::stats.records, however that one is relatively @@ -3076,7 +3076,7 @@ public: DBUG_ASSERT(idx < table->s->fields); return col_stat[idx].min_null_row; } - ha_rows get_max_nulls_in_row() { return max_nulls_in_row; } + uint get_max_nulls_in_row() { return max_nulls_in_row; } }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2880c818b8c..7070fe5890f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4616,9 +4616,10 @@ best_access_path(JOIN *join, tmp= records; set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key); if (table->covering_keys.is_set(key)) - tmp= table->file->keyread_time(key, 1, tmp); + tmp= table->file->keyread_time(key, 1, (ha_rows) tmp); else - tmp= table->file->read_time(key, 1, min(tmp,s->worst_seeks)-1); + tmp= table->file->read_time(key, 1, + (ha_rows) min(tmp,s->worst_seeks)-1); tmp*= record_count; } } @@ -4779,9 +4780,10 @@ best_access_path(JOIN *join, /* Limit the number of matched rows */ set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key); if (table->covering_keys.is_set(key)) - tmp= table->file->keyread_time(key, 1, tmp); + tmp= table->file->keyread_time(key, 1, (ha_rows) tmp); else - tmp= table->file->read_time(key, 1, min(tmp,s->worst_seeks)-1); + tmp= table->file->read_time(key, 1, + (ha_rows) min(tmp,s->worst_seeks)-1); tmp*= record_count; } else @@ -18426,8 +18428,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, item_list.push_back(new Item_string("func", strlen("func"), cs)); } /* rows */ - ha_rows rows= (sj_strategy == SJ_OPT_MATERIALIZE_SCAN)? - tab->emb_sj_nest->sj_mat_info->rows : 1; + ha_rows rows= (ha_rows) ((sj_strategy == SJ_OPT_MATERIALIZE_SCAN)? + tab->emb_sj_nest->sj_mat_info->rows : 1.0); item_list.push_back(new Item_int((longlong)rows, MY_INT64_NUM_DECIMAL_DIGITS)); /* filtered */ diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 20d01c62b31..2d2c23a2ed6 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -695,7 +695,10 @@ int ha_heap::create(const char *name, TABLE *table_arg, (uchar*) table_arg->record[0]); } else - seg->bit_length= seg->bit_start= seg->bit_pos= 0; + { + seg->bit_length= seg->bit_start= 0; + seg->bit_pos= 0; + } } } mem_per_row+= MY_ALIGN(share->reclength + 1, sizeof(char*)); diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index e0c66134858..f16d91635c5 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -754,19 +754,19 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row) if (row.orig_indicator) { field[1]->set_notnull(); - field[1]->store((longlong) row.orig); + field[1]->store((longlong) row.orig, 0); } if (row.dest_indicator) { field[2]->set_notnull(); - field[2]->store((longlong) row.dest); + field[2]->store((longlong) row.dest, 0); } if (row.weight_indicator) { field[3]->set_notnull(); - field[3]->store((double) row.weight); + field[3]->store((double) row.weight, 0); } if (row.seq_indicator) @@ -778,7 +778,7 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row) if (row.link_indicator) { field[5]->set_notnull(); - field[5]->store((longlong) row.link); + field[5]->store((longlong) row.link, 0); } if (ptrdiff) |