summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-04-05 23:48:49 -0700
committerIgor Babaev <igor@askmonty.org>2013-04-05 23:48:49 -0700
commit1ae352afbe40a71f26cec2da0f08eefdef05f41f (patch)
treee3bd1f7a38f6911c1c95d9271908771a4ab0fe11 /sql/sql_statistics.cc
parent503731d80f732a3a790443cc530fea2c3721b869 (diff)
downloadmariadb-git-1ae352afbe40a71f26cec2da0f08eefdef05f41f.tar.gz
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.
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r--sql/sql_statistics.cc6
1 files changed, 4 insertions, 2 deletions
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;
}