summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-04-06 15:36:28 -0700
committerIgor Babaev <igor@askmonty.org>2013-04-06 15:36:28 -0700
commit10f0530b22d1b06c79be9fef26febebf3b9ec4a5 (patch)
treeddc4d541ec04f3d575bca47c512d6201342defef /sql/sql_statistics.cc
parent1c30fb2a156b9c510e1829108bc8db71dcea3d43 (diff)
downloadmariadb-git-10f0530b22d1b06c79be9fef26febebf3b9ec4a5.tar.gz
Fixed bug mdev-4369.
The function was adjusted to be able to aggregate the counters of the merged elements. Before this change it was not possible to guarantee the correctness of the counters passed to the the call-back parameter walk_action. As a result, when some elements of a Unique object were flushed into disk the function passed to merge_walk() as the call-back parameter could return wrong counters of elements. This could lead to building wrong histograms.
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r--sql/sql_statistics.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 6e476b34e0d..37c3a93ee08 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -1348,7 +1348,7 @@ public:
tree_key_length= field->pack_length();
tree= new Unique((qsort_cmp2) simple_str_key_cmp, (void*) field,
- tree_key_length, max_heap_table_size);
+ tree_key_length, max_heap_table_size, 1);
}
virtual ~Count_distinct_field()
@@ -1435,7 +1435,7 @@ public:
tree= new Unique((qsort_cmp2) simple_ulonglong_key_cmp,
(void*) &tree_key_length,
- tree_key_length, max_heap_table_size);
+ tree_key_length, max_heap_table_size, 1);
}
bool add()