From f1134d567695990dc7d62b6c25e4b9aa8de439e0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 15 Mar 2019 15:03:26 +0100 Subject: post-merge: gcc 8 warnings note: Inherit String from Sql_alloc, to get operators new and new[] in sync in rocksdb gcc was complaining that non-lvalue was cast to const. --- sql/item_jsonfunc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/item_jsonfunc.cc') diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 78eb58506ff..e236010c459 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -680,11 +680,11 @@ static int alloc_tmp_paths(THD *thd, uint n_paths, *paths= (json_path_with_flags *) alloc_root(root, sizeof(json_path_with_flags) * n_paths); - *tmp_paths= (String *) alloc_root(root, sizeof(String) * n_paths); + + *tmp_paths= new (root) String[n_paths]; if (*paths == 0 || *tmp_paths == 0) return 1; - bzero(*tmp_paths, sizeof(String) * n_paths); for (uint c_path=0; c_path < n_paths; c_path++) (*tmp_paths)[c_path].set_charset(&my_charset_utf8_general_ci); } -- cgit v1.2.1