revision-id: 18f3ac5f43260ca6e4f03bba567b31a4eb4cf18e (mariadb-10.6.1-104-g18f3ac5f432) parent(s): 2901eeaa39148a9a3e1f12535a325748a665851f author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2021-08-31 00:31:29 +0300 message: Fix valgrind failure --- sql/sql_statistics.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 4beb3ec4448..3fba18f221b 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -2057,7 +2057,7 @@ class Histogram_builder_json : public Histogram_builder StringBuffer<MAX_FIELD_WIDTH> val; column->val_str(&val); auto it = bucket_bounds.begin(); - bucket_bounds.insert(it+curr_bucket, val.c_ptr()); + bucket_bounds.insert(it+curr_bucket, std::string(val.ptr(), val.length())); curr_bucket++; while (curr_bucket != hist_width && count > bucket_capacity * (curr_bucket + 1))