[Commits] 3b0535f: MDEV-16188 Post merge fixes:fixed warnings on Windows
revision-id: 3b0535ff1d58fa18360a376ec30faef8c2965bcc (mariadb-10.3.6-106-g3b0535f) parent(s): e299ae5b0786aa9348e422f4271fb344d51f60fa author: Igor Babaev committer: Igor Babaev timestamp: 2019-02-06 12:57:30 -0800 message: MDEV-16188 Post merge fixes:fixed warnings on Windows --- mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff | 9 +++++++++ sql/handler.cc | 2 +- sql/multi_range_read.cc | 6 ++++-- sql/rowid_filter.cc | 7 ++++--- sql/rowid_filter.h | 2 +- sql/sql_explain.cc | 3 ++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index 5d47090..e10b2c5 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -507,6 +507,15 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 +@@ -2261,7 +2261,7 @@ + VARIABLE_TYPE BIGINT UNSIGNED + VARIABLE_COMMENT The maximum size of the container of a rowid filter + NUMERIC_MIN_VALUE 1024 +-NUMERIC_MAX_VALUE 18446744073709551615 ++NUMERIC_MAX_VALUE 4294967295 + NUMERIC_BLOCK_SIZE 1 + ENUM_VALUE_LIST NULL + READ_ONLY NO @@ -2284,7 +2284,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 diff --git a/sql/handler.cc b/sql/handler.cc index 932797a..b1a2719 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2826,7 +2826,7 @@ double handler::keyread_time(uint index, uint ranges, ha_rows rows) size_t len= table->key_info[index].key_length + ref_length; if (index == table->s->primary_key && table->file->primary_key_is_clustered()) len= table->s->stored_rec_length; - uint keys_per_block= (stats.block_size/2.0/len+1); + uint keys_per_block= (uint) (stats.block_size/2.0/len+1); ulonglong blocks= !rows ? 0 : (rows-1) / keys_per_block + 1; double cost= (double)rows*len/(stats.block_size+1)*IDX_BLOCK_COPY_COST; if (ranges) diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index cab278f..12f72f5 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -20,7 +20,7 @@ #include "key.h" #include "sql_statistics.h" -static ulonglong key_block_no(handler *h, uint keyno, uint keyentry_pos) +static ulonglong key_block_no(handler *h, uint keyno, ha_rows keyentry_pos) { return (ulonglong) (h->keyread_time(keyno, 1, keyentry_pos + 1) - h->keyread_time(keyno, 0, keyentry_pos + 1) + 0.5) + 1; @@ -217,7 +217,9 @@ handler::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, } else { - cost->io_count= read_time(keyno, total_touched_blocks, (uint) total_rows); + cost->io_count= read_time(keyno, + (uint)total_touched_blocks, + (uint) total_rows); cost->cpu_cost= (double) total_rows / TIME_FOR_COMPARE + 0.01; } } diff --git a/sql/rowid_filter.cc b/sql/rowid_filter.cc index 4348eea..a7cf09b 100644 --- a/sql/rowid_filter.cc +++ b/sql/rowid_filter.cc @@ -64,7 +64,7 @@ void Range_rowid_filter_cost_info::init(Rowid_filter_container_type cont_type, container_type= cont_type; table= tab; key_no= idx; - est_elements= table->quick_rows[key_no]; + est_elements= (ulonglong) (table->quick_rows[key_no]); b= build_cost(container_type); selectivity= est_elements/((double) table->stat_records()); a= avg_access_and_eval_gain_per_row(container_type); @@ -108,7 +108,8 @@ Rowid_filter_container *Range_rowid_filter_cost_info::create_container() switch (container_type) { case SORTED_ARRAY_CONTAINER: - res= new (thd->mem_root) Rowid_filter_sorted_array(est_elements, elem_sz); + res= new (thd->mem_root) Rowid_filter_sorted_array((uint) est_elements, + elem_sz); break; default: DBUG_ASSERT(0); @@ -245,7 +246,7 @@ void TABLE::prune_range_rowid_filters() Return maximum number of elements that a container allowed to have */ -static uint +static ulonglong get_max_range_rowid_filter_elems_for_table( THD *thd, TABLE *tab, Rowid_filter_container_type cont_type) diff --git a/sql/rowid_filter.h b/sql/rowid_filter.h index 3cc2c31..9f43073 100644 --- a/sql/rowid_filter.h +++ b/sql/rowid_filter.h @@ -373,7 +373,7 @@ class Range_rowid_filter_cost_info : public Sql_alloc /* The table for which the range filter is to be built (if needed) */ TABLE *table; /* Estimated number of elements in the filter */ - double est_elements; + ulonglong est_elements; /* The cost of building the range filter */ double b; /* diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index c7c6f15..f32a9c3 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1313,7 +1313,8 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai if (rowid_filter) { rows_str.append(" ("); - rows_str.append_ulonglong(round(rowid_filter->selectivity * 100.0)); + rows_str.append_ulonglong((ulonglong) (round(rowid_filter->selectivity * + 100.0))); rows_str.append("%)"); } item_list.push_back(new (mem_root)
participants (1)
-
IgorBabaev