summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-09-06 22:45:19 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-09-06 22:45:19 +0200
commit31081593aabb116b6d8f86b6c7e76126edb392b4 (patch)
tree767a069f255359b5ea37e7c491dfeacf6e519fad /sql/sql_statistics.h
parentb0026e33af8fc3b25a42099c096a84591fd550e2 (diff)
parent3a4242fd57b3a2235d2478ed080941b67a82ad1b (diff)
downloadmariadb-git-31081593aabb116b6d8f86b6c7e76126edb392b4.tar.gz
Merge branch '11.0' into 10.1
Diffstat (limited to 'sql/sql_statistics.h')
-rw-r--r--sql/sql_statistics.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/sql/sql_statistics.h b/sql/sql_statistics.h
index 0611c021e88..d30691c32f0 100644
--- a/sql/sql_statistics.h
+++ b/sql/sql_statistics.h
@@ -345,12 +345,17 @@ private:
public:
Histogram histogram;
+
+ uint32 no_values_provided_bitmap()
+ {
+ return
+ ((1 << (COLUMN_STAT_HISTOGRAM-COLUMN_STAT_COLUMN_NAME))-1) <<
+ (COLUMN_STAT_COLUMN_NAME+1);
+ }
void set_all_nulls()
{
- column_stat_nulls=
- ((1 << (COLUMN_STAT_HISTOGRAM-COLUMN_STAT_COLUMN_NAME))-1) <<
- (COLUMN_STAT_COLUMN_NAME+1);
+ column_stat_nulls= no_values_provided_bitmap();
}
void set_not_null(uint stat_field_no)
@@ -396,8 +401,22 @@ public:
bool min_max_values_are_provided()
{
return !is_null(COLUMN_STAT_MIN_VALUE) &&
- !is_null(COLUMN_STAT_MIN_VALUE);
- }
+ !is_null(COLUMN_STAT_MAX_VALUE);
+ }
+ /*
+ This function checks whether the values for the fields of the statistical
+ tables that were NULL by DEFAULT for a column have changed or not.
+
+ @retval
+ TRUE: Statistics are not present for a column
+ FALSE: Statisitics are present for a column
+ */
+ bool no_stat_values_provided()
+ {
+ if (column_stat_nulls == no_values_provided_bitmap())
+ return true;
+ return false;
+ }
};