mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
"mysql" now sends client character set to server.
This commit is contained in:
@ -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,
|
|||||||
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)
|
|||||||
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
|
||||||
|
Reference in New Issue
Block a user