Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ebc2f0da
Commit
ebc2f0da
authored
Oct 03, 2017
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using HA_POS_ERROR constant when passing around values of type double.
This is error-prone and causes warnings on Windows
parent
325e071c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
sql/opt_range.cc
sql/opt_range.cc
+4
-4
sql/sql_statistics.cc
sql/sql_statistics.cc
+4
-1
No files found.
sql/opt_range.cc
View file @
ebc2f0da
...
...
@@ -2827,7 +2827,7 @@ double records_in_column_ranges(PARAM *param, uint idx,
/* Handle cases when we don't have a valid non-empty list of range */
if
(
!
tree
)
return
HA_POS_ERROR
;
return
DBL_MAX
;
if
(
tree
->
type
==
SEL_ARG
::
IMPOSSIBLE
)
return
(
0L
);
...
...
@@ -2847,9 +2847,9 @@ double records_in_column_ranges(PARAM *param, uint idx,
max_endp
=
range
.
end_key
.
length
?
&
range
.
end_key
:
NULL
;
rows
=
get_column_range_cardinality
(
field
,
min_endp
,
max_endp
,
range
.
range_flag
);
if
(
HA_POS_ERROR
==
rows
)
if
(
DBL_MAX
==
rows
)
{
total_rows
=
HA_POS_ERROR
;
total_rows
=
DBL_MAX
;
break
;
}
total_rows
+=
rows
;
...
...
@@ -3083,7 +3083,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
else
{
rows
=
records_in_column_ranges
(
&
param
,
idx
,
key
);
if
(
rows
!=
HA_POS_ERROR
)
if
(
rows
!=
DBL_MAX
)
key
->
field
->
cond_selectivity
=
rows
/
table_records
;
}
}
...
...
sql/sql_statistics.cc
View file @
ebc2f0da
...
...
@@ -3752,7 +3752,10 @@ double get_column_avg_frequency(Field * field)
using the statistical data from the table column_stats.
@retval
The required estimate of the rows in the column range
- The required estimate of the rows in the column range
- If there is some kind of error, this function should return DBL_MAX (and
not HA_POS_ERROR as that is an integer constant).
*/
double
get_column_range_cardinality
(
Field
*
field
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment