From 38cad6875f2c85f5190eaae7b9da7c43e591eff2 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Thu, 28 Mar 2019 13:14:49 +0530 Subject: MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value To fix the crash there we need to make sure that the server while storing the statistical values in statistical tables should do it in a multi-byte safe way. Also there is no need to throw warnings if there is truncation while storing values from statistical fields. --- sql/field.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sql/field.cc') diff --git a/sql/field.cc b/sql/field.cc index 080cf34c76d..0621015c0e4 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7027,8 +7027,11 @@ Field_longstr::check_string_copy_error(const String_copier *copier, if (!(pos= copier->most_important_error_pos())) return FALSE; - convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6); - set_warning_truncated_wrong_value("string", tmp); + if (!is_stat_field) + { + convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6); + set_warning_truncated_wrong_value("string", tmp); + } return TRUE; } -- cgit v1.2.1