1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

bug #20318 (ctype_ucs2_def test fails with embedded)

there was two problems about charsets in embedded server
1. mysys/charset.c - defined there default_charset_info variable is
modified by both server and client code (particularly when
--default-charset option is handled)
In embedded server we get two codelines modifying one variable.
I created separate default_client_charset_info for client code

2. mysql->charset and mysql->options.charset initialization isn't
properly done for embedded server - necessary calls added
This commit is contained in:
holyfoot@deer.(none)
2006-06-19 22:11:01 +05:00
parent 47bb569979
commit d8d42948b2
5 changed files with 91 additions and 108 deletions

View File

@ -41,6 +41,8 @@ static const char *fake_groups[] = { "server", "embedded", 0 };
int check_user(THD *thd, enum enum_server_command command,
const char *passwd, uint passwd_len, const char *db,
bool check_count);
void thd_init_client_charset(THD *thd, uint cs_number);
C_MODE_START
#include <mysql.h>
#undef ER
@ -532,10 +534,13 @@ err:
return NULL;
}
#ifdef NO_EMBEDDED_ACCESS_CHECKS
int check_embedded_connection(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
thd_init_client_charset(thd, mysql->charset->number);
thd->update_charset();
thd->host= (char*)my_localhost;
thd->host_or_ip= thd->host;
thd->user= my_strdup(mysql->user, MYF(0));
@ -551,6 +556,8 @@ int check_embedded_connection(MYSQL *mysql)
char scramble_buff[SCRAMBLE_LENGTH];
int passwd_len;
thd_init_client_charset(thd, mysql->charset->number);
thd->update_charset();
if (mysql->options.client_ip)
{
thd->host= my_strdup(mysql->options.client_ip, MYF(0));