From c4807c107a46597f52565243a722992467383a73 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 23 Mar 2021 21:53:27 +0100 Subject: MDEV-24879 Client crash on undefined charsetsdir --- client/mysql.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/mysql.cc b/client/mysql.cc index f61fab416d5..2eb44d46512 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -4720,7 +4720,11 @@ sql_real_connect(char *host,char *database,char *user,char *password, return -1; // Retryable } - charset_info= get_charset_by_name(mysql.charset->name, MYF(0)); + if (!(charset_info= get_charset_by_name(mysql.charset->name, MYF(0)))) + { + put_info("Unknown default character set", INFO_ERROR); + return 1; + } connected=1; -- cgit v1.2.1