From 1ae352afbe40a71f26cec2da0f08eefdef05f41f Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 5 Apr 2013 23:48:49 -0700 Subject: Fixed bugs mdev-4357 and mdev-4359. The values of the column HIST_TYPE from the statistical table mysql.column_stats were stored in the table and read from the table incorrectly. --- sql/sql_statistics.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql/sql_statistics.cc') diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index b556c37c3fb..6e476b34e0d 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -929,7 +929,8 @@ public: stat_field->store(table_field->collected_stats->histogram.get_size()); break; case COLUMN_STAT_HIST_TYPE: - stat_field->store(table_field->collected_stats->histogram.get_type()); + stat_field->store(table_field->collected_stats->histogram.get_type() + + 1); break; case COLUMN_STAT_HISTOGRAM: const char * col_histogram= @@ -1011,7 +1012,8 @@ public: table_field->read_stats->histogram.set_size(stat_field->val_int()); break; case COLUMN_STAT_HIST_TYPE: - Histogram_type hist_type= (Histogram_type) (stat_field->val_int()); + Histogram_type hist_type= (Histogram_type) (stat_field->val_int() - + 1); table_field->read_stats->histogram.set_type(hist_type); break; } -- cgit v1.2.1