diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2014-10-06 15:29:22 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2014-10-06 15:29:22 +0400 |
commit | fd4c9af3987814e0e13f429c900ea0256a435cbe (patch) | |
tree | 49864d7aa239cf0a46a121b0d1415b8f790f747b /sql/sql_statistics.h | |
parent | 689ffe3559a4b7bacd13503ba93659b2f4560bbb (diff) | |
download | mariadb-git-fd4c9af3987814e0e13f429c900ea0256a435cbe.tar.gz |
MDEV-6442: Assertion `join->best_read < double(...)' failed with optimizer_use_condition_selectivity >=3
- Fix the crash by making get_column_range_cardinality()
to handle the special case where Column_stats objects
is an all-zeros object (the question of what is the point
of having Field::read_stats point to such object remains a
mystery)
- Added a few comments. Learning the code still.
Diffstat (limited to 'sql/sql_statistics.h')
-rw-r--r-- | sql/sql_statistics.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_statistics.h b/sql/sql_statistics.h index c399951b828..46e5cef22d1 100644 --- a/sql/sql_statistics.h +++ b/sql/sql_statistics.h @@ -280,7 +280,14 @@ public: }; -/* Statistical data on a column */ +/* + Statistical data on a column + + Note: objects of this class may be "empty", where they have almost all fields + as zeros, for example, get_avg_frequency() will return 0. + + objects are allocated in alloc_statistics_for_table[_share]. +*/ class Column_statistics { @@ -296,7 +303,8 @@ public: are available for the column */ uint32 column_stat_nulls; - + + /* For the below two, see comments in get_column_range_cardinality() */ /* Minimum value for the column */ Field *min_value; /* Maximum value for the column */ |