Commit 097e2f9d authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-16188: Fix clang 10 -Wimplicit-int-float-conversion

mi_records_in_range(): Because HA_POS_ERROR cannot be accurately
represented in double (it will be off by one), add an explicit
cast to silence the warning.
parent b7f06447
/* /*
Copyright (c) 2000, 2011, Oracle and/or its affiliates Copyright (c) 2000, 2011, Oracle and/or its affiliates
Copyright (c) 2010, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -104,7 +105,7 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, ...@@ -104,7 +105,7 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx,
: (double) info->state->records); : (double) info->state->records);
res= (end_pos < start_pos ? (ha_rows) 0 : res= (end_pos < start_pos ? (ha_rows) 0 :
(end_pos == start_pos ? (ha_rows) 1 : (ha_rows) (end_pos-start_pos))); (end_pos == start_pos ? (ha_rows) 1 : (ha_rows) (end_pos-start_pos)));
if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR) if (start_pos == (double) HA_POS_ERROR || end_pos == (double) HA_POS_ERROR)
res=HA_POS_ERROR; res=HA_POS_ERROR;
else else
{ {
......
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