1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Fixed bug mdev-6843.

The function  get_column_range_cardinality() returned a wrong result for any column
containing only null values.
This commit is contained in:
Igor Babaev
2014-10-28 22:31:52 -07:00
parent 2d088e265c
commit 100b10d8ef
4 changed files with 91 additions and 1 deletions

View File

@ -3502,7 +3502,12 @@ double get_column_range_cardinality(Field *field,
!(range_flag & NEAR_MIN);
if (col_non_nulls < 1)
res= 0; /* this is likely wrong, see MDEV-6843 */
{
if (nulls_incl)
res= col_nulls;
else
res= 0;
}
else if (min_endp && max_endp && min_endp->length == max_endp->length &&
!memcmp(min_endp->key, max_endp->key, min_endp->length))
{