summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-02-02 10:02:03 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2019-02-02 17:32:15 +0100
commit261ce5286f266f1a5fab5e8adc2c08adef658d13 (patch)
tree8f74ae3a7b7e4aed0b1f106082e98d66ad659774 /client
parent915ed7e614383093d688db6b4fd8bc7b948e1b70 (diff)
downloadmariadb-git-261ce5286f266f1a5fab5e8adc2c08adef658d13.tar.gz
MDEV-18281 COM_RESET_CONNECTION changes the connection encoding
Store original charset during client authentication, and restore it for COM_RESET_CONNECTION
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 227c40f8d01..0d7b54acf8e 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5938,6 +5938,7 @@ void do_connect(struct st_command *command)
int read_timeout= 0;
int write_timeout= 0;
int connect_timeout= 0;
+ char *csname=0;
struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
@@ -6049,6 +6050,11 @@ void do_connect(struct st_command *command)
{
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
}
+ else if (strncasecmp(con_options, "CHARSET=",
+ sizeof("CHARSET=") - 1) == 0)
+ {
+ csname= strdup(con_options + sizeof("CHARSET=") - 1);
+ }
else
die("Illegal option to connect: %.*s",
(int) (end - con_options), con_options);
@@ -6086,7 +6092,7 @@ void do_connect(struct st_command *command)
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
- charset_info->csname);
+ csname?csname: charset_info->csname);
if (opt_charsets_dir)
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
@@ -6197,6 +6203,7 @@ void do_connect(struct st_command *command)
#ifdef HAVE_SMEM
dynstr_free(&ds_shm);
#endif
+ free(csname);
DBUG_VOID_RETURN;
}