Commit 47073e21 authored by Sergei Petrunia's avatar Sergei Petrunia Committed by Sergei Golubchik

Fix typecast warnings-as-errors on Windows.

parent 8c5a4e5d
...@@ -2471,9 +2471,9 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { ...@@ -2471,9 +2471,9 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"index": "a_c", "index": "a_c",
"can_resolve_order": true, "can_resolve_order": true,
"direction": 1, "direction": 1,
"rows_to_examine": 4, "rows_to_examine": 4.390243902,
"range_scan": true, "range_scan": true,
"scan_cost": 10.5218905, "scan_cost": 11.5484164,
"chosen": true "chosen": true
}, },
{ {
......
...@@ -2540,8 +2540,12 @@ bool optimize_semijoin_nests(JOIN *join, table_map all_table_map) ...@@ -2540,8 +2540,12 @@ bool optimize_semijoin_nests(JOIN *join, table_map all_table_map)
int tableno; int tableno;
double rows= 1.0; double rows= 1.0;
while ((tableno = tm_it.next_bit()) != Table_map_iterator::BITMAP_END) while ((tableno = tm_it.next_bit()) != Table_map_iterator::BITMAP_END)
rows= COST_MULT(rows, {
join->map2table[tableno]->table->opt_range_condition_rows); ha_rows tbl_rows=join->map2table[tableno]->
table->opt_range_condition_rows;
rows= COST_MULT(rows, rows2double(tbl_rows));
}
sjm->rows= MY_MIN(sjm->rows, rows); sjm->rows= MY_MIN(sjm->rows, rows);
} }
memcpy((uchar*) sjm->positions, memcpy((uchar*) sjm->positions,
......
...@@ -29983,11 +29983,12 @@ void JOIN::cache_const_exprs() ...@@ -29983,11 +29983,12 @@ void JOIN::cache_const_exprs()
static bool get_range_limit_read_cost(const POSITION *pos, static bool get_range_limit_read_cost(const POSITION *pos,
const TABLE *table, const TABLE *table,
uint keynr, uint keynr,
ha_rows rows_limit, ha_rows rows_limit_arg,
ha_rows rows_to_scan, ha_rows rows_to_scan,
double *read_cost, double *read_cost,
double *read_rows) double *read_rows)
{ {
double rows_limit= rows2double(rows_limit_arg);
if (table->opt_range_keys.is_set(keynr)) if (table->opt_range_keys.is_set(keynr))
{ {
/* /*
...@@ -30058,7 +30059,7 @@ static bool get_range_limit_read_cost(const POSITION *pos, ...@@ -30058,7 +30059,7 @@ static bool get_range_limit_read_cost(const POSITION *pos,
HA_ROWS_MAX); HA_ROWS_MAX);
*read_cost= (cost.read_cost + *read_cost= (cost.read_cost +
rows_to_scan * WHERE_COST_THD(table->in_use)); rows_to_scan * WHERE_COST_THD(table->in_use));
*read_rows= rows_to_scan; *read_rows= rows2double(rows_to_scan);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment