diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-06-17 09:56:00 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-06-17 18:04:47 +0100 |
commit | 5804bb4ef0acd7ac42e628c2d8c404957dc86cf9 (patch) | |
tree | d8180213953c76959d0a19aeb9c3e688722b23e2 /client/mysqlcheck.c | |
parent | 81f60e8adeb241ed845427e0792349f3a05af99b (diff) | |
download | mariadb-git-5804bb4ef0acd7ac42e628c2d8c404957dc86cf9.tar.gz |
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.
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r-- | client/mysqlcheck.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index ae8ddeec59c..42c4cae5621 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -440,8 +440,10 @@ static int get_options(int *argc, char ***argv) else default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; } - if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) && - !get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME))) + if (!strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); + + if (!get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME))) { printf("Unsupported character set: %s\n", default_charset); DBUG_RETURN(1); |