"mysql" now sends client character set to server.
This commit is contained in:
parent
7df5635ff2
commit
7ffcf6f64a
@ -2549,6 +2549,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
|
||||
select_limit,max_join_size);
|
||||
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
|
||||
}
|
||||
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
|
||||
if (!mysql_real_connect(&mysql, host, user, password,
|
||||
database, opt_mysql_port, opt_mysql_unix_port,
|
||||
connect_flag | CLIENT_MULTI_QUERIES))
|
||||
|
@ -2241,7 +2241,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
const char *save=charsets_dir;
|
||||
if (mysql->options.charset_dir)
|
||||
charsets_dir=mysql->options.charset_dir;
|
||||
mysql->charset=get_charset_by_name(mysql->options.charset_name,
|
||||
mysql->charset=get_charset_by_csname(mysql->options.charset_name,
|
||||
MY_CS_PRIMARY,
|
||||
MYF(MY_WME));
|
||||
charsets_dir=save;
|
||||
}
|
||||
|
@ -664,8 +664,17 @@ check_connections(THD *thd)
|
||||
thd->max_client_packet_length= uint4korr(net->read_pos+4);
|
||||
if (!(thd->variables.character_set_client=
|
||||
get_charset((uint) net->read_pos[8], MYF(0))))
|
||||
{
|
||||
thd->variables.character_set_client=
|
||||
global_system_variables.character_set_client;
|
||||
thd->variables.collation_connection=
|
||||
global_system_variables.collation_connection;
|
||||
}
|
||||
else
|
||||
{
|
||||
thd->variables.collation_connection=
|
||||
thd->variables.character_set_client;
|
||||
}
|
||||
end= (char*) net->read_pos+32;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user