mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Semi-join fixes: make COST_VECT objects survive add_io(add_io_cnt=0, add_avg_cost=...) calls without
getting NaN in internal fields.
This commit is contained in:
parent
0ce603ab5e
commit
9e7495df83
1 changed files with 8 additions and 4 deletions
|
@ -1390,10 +1390,14 @@ public:
|
|||
}
|
||||
void add_io(double add_io_cnt, double add_avg_cost)
|
||||
{
|
||||
double io_count_sum= io_count + add_io_cnt;
|
||||
avg_io_cost= (io_count * avg_io_cost +
|
||||
add_io_cnt * add_avg_cost) / io_count_sum;
|
||||
io_count= io_count_sum;
|
||||
/* In edge cases add_io_cnt may be zero */
|
||||
if (add_io_cnt > 0)
|
||||
{
|
||||
double io_count_sum= io_count + add_io_cnt;
|
||||
avg_io_cost= (io_count * avg_io_cost +
|
||||
add_io_cnt * add_avg_cost) / io_count_sum;
|
||||
io_count= io_count_sum;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue