From 5804bb4ef0acd7ac42e628c2d8c404957dc86cf9 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 17 Jun 2019 09:56:00 +0100 Subject: MDEV-19750 mysql command wrong encoding Restore the detection of default charset in command line utilities. It worked up to 10.1, but was broken by Connector/C. Moved code for detection of default charset from sql-common/client.c to mysys, and make command line utilities to use this code if charset was not specified on the command line. --- client/mysqladmin.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'client/mysqladmin.cc') diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index ef8cb27e672..a4e06b46d94 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -26,6 +26,7 @@ #include #include #include +#include #define ADMIN_VERSION "9.1" #define MAX_MYSQL_VAR 512 @@ -371,6 +372,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); error_flags= (myf)(opt_nobeep ? 0 : ME_BELL); -- cgit v1.2.1