summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.cc
diff options
context:
space:
mode:
authorMichael Okoko <okokomichaels@outlook.com>2021-08-22 15:37:14 +0100
committerSergei Petrunia <psergey@askmonty.org>2022-01-19 18:10:09 +0300
commit058a90e6f53dbf75bd3c39596f982042da2cfd7f (patch)
tree94dddebc457656e21c9d885932e7b74c76e3ab09 /sql/sql_statistics.cc
parent3692adebd4300130d26a5e27be0dce7e4c0162af (diff)
downloadmariadb-git-058a90e6f53dbf75bd3c39596f982042da2cfd7f.tar.gz
Use existing statistics test to improve coverage for JSON statistics
Signed-off-by: Michael Okoko <okokomichaels@outlook.com>
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r--sql/sql_statistics.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index cd84032b2e5..5d0e65704f0 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -1992,6 +1992,7 @@ public:
class Histogram_builder_json : public Histogram_builder
{
std::vector<std::string> bucket_bounds;
+ bool got_first_value = false;
public:
Histogram_builder_json(Field *col, uint col_len, ha_rows rows)
@@ -2021,7 +2022,7 @@ public:
while (curr_bucket != hist_width &&
count > bucket_capacity * (curr_bucket + 1))
{
- auto it = bucket_bounds.begin();
+ it = bucket_bounds.begin();
bucket_bounds.insert(it+curr_bucket, bucket_bounds[curr_bucket-1]);
curr_bucket++;
}