Commit 1328c29e authored by unknown's avatar unknown

"mysql" now sends client character set to server.

parent 15b3f3a0
...@@ -2549,6 +2549,7 @@ sql_real_connect(char *host,char *database,char *user,char *password, ...@@ -2549,6 +2549,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
select_limit,max_join_size); select_limit,max_join_size);
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command); 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, if (!mysql_real_connect(&mysql, host, user, password,
database, opt_mysql_port, opt_mysql_unix_port, database, opt_mysql_port, opt_mysql_unix_port,
connect_flag | CLIENT_MULTI_QUERIES)) connect_flag | CLIENT_MULTI_QUERIES))
......
...@@ -2241,7 +2241,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, ...@@ -2241,7 +2241,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *save=charsets_dir; const char *save=charsets_dir;
if (mysql->options.charset_dir) if (mysql->options.charset_dir)
charsets_dir=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)); MYF(MY_WME));
charsets_dir=save; charsets_dir=save;
} }
......
...@@ -664,8 +664,17 @@ check_connections(THD *thd) ...@@ -664,8 +664,17 @@ check_connections(THD *thd)
thd->max_client_packet_length= uint4korr(net->read_pos+4); thd->max_client_packet_length= uint4korr(net->read_pos+4);
if (!(thd->variables.character_set_client= if (!(thd->variables.character_set_client=
get_charset((uint) net->read_pos[8], MYF(0)))) get_charset((uint) net->read_pos[8], MYF(0))))
{
thd->variables.character_set_client= thd->variables.character_set_client=
global_system_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; end= (char*) net->read_pos+32;
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment