From 56402e84b5ba242214ff4d3c4a647413cbe60ff3 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 16 Mar 2020 11:43:30 +0100 Subject: [PATCH] MDEV-21824 Crash in convert_error_message restore check for client charset_info == NULL, which was previously removed in MDEV-8844 --- sql/sql_error.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 4045f30a6bd..e5dda9904d2 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -947,7 +947,7 @@ size_t convert_error_message(char *to, size_t to_length, CHARSET_INFO *to_cs, /* Make room for the null terminator. */ to_length--; - if (to_cs == &my_charset_bin) + if (!to_cs || to_cs == &my_charset_bin) to_cs= system_charset_info; uint32 cnv_length= my_convert_using_func(to, to_length, to_cs,