mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "my_readline.h"
|
||||
#include <signal.h>
|
||||
#include <violite.h>
|
||||
#include <my_sys.h>
|
||||
|
||||
#if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H)
|
||||
#include <locale.h>
|
||||
@@ -4701,7 +4702,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
|
||||
select_limit,max_join_size);
|
||||
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
|
||||
}
|
||||
|
||||
if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME))
|
||||
default_charset= (char *)my_default_csname();
|
||||
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
|
||||
|
||||
if (!do_connect(&mysql, host, user, password, database,
|
||||
|
Reference in New Issue
Block a user