Preparation to thread specific default charset
This commit is contained in:
parent
75dc4d5ce5
commit
e086000f19
@ -108,6 +108,7 @@ THD::THD():user_time(0), fatal_error(0),
|
|||||||
file_id = 0;
|
file_id = 0;
|
||||||
cond_count=0;
|
cond_count=0;
|
||||||
db_charset=default_charset_info;
|
db_charset=default_charset_info;
|
||||||
|
thd_charset=default_charset_info;
|
||||||
mysys_var=0;
|
mysys_var=0;
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
dbug_sentry=THD_SENTRY_MAGIC;
|
dbug_sentry=THD_SENTRY_MAGIC;
|
||||||
|
@ -481,6 +481,7 @@ public:
|
|||||||
table_map used_tables;
|
table_map used_tables;
|
||||||
USER_CONN *user_connect;
|
USER_CONN *user_connect;
|
||||||
CHARSET_INFO *db_charset;
|
CHARSET_INFO *db_charset;
|
||||||
|
CHARSET_INFO *thd_charset;
|
||||||
List <MYSQL_ERROR> warn_list;
|
List <MYSQL_ERROR> warn_list;
|
||||||
uint warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
|
uint warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
|
||||||
uint total_warn_count, old_total_warn_count;
|
uint total_warn_count, old_total_warn_count;
|
||||||
|
@ -592,7 +592,7 @@ bool mysql_change_db(THD *thd, const char *name)
|
|||||||
strmov(path+unpack_dirname(path,path), MY_DB_OPT_FILE);
|
strmov(path+unpack_dirname(path,path), MY_DB_OPT_FILE);
|
||||||
load_db_opt(path, &create);
|
load_db_opt(path, &create);
|
||||||
thd->db_charset=create.table_charset;
|
thd->db_charset=create.table_charset;
|
||||||
|
thd->thd_charset=thd->db_charset ? thd->db_charset : default_charset_info;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3309,13 +3309,13 @@ opt_ignore_lines:
|
|||||||
/* Common definitions */
|
/* Common definitions */
|
||||||
|
|
||||||
text_literal:
|
text_literal:
|
||||||
TEXT_STRING { $$ = new Item_string($1.str,$1.length,default_charset_info); }
|
TEXT_STRING { $$ = new Item_string($1.str,$1.length,current_thd->thd_charset); }
|
||||||
| UNDERSCORE_CHARSET TEXT_STRING { $$ = new Item_string($2.str,$2.length,Lex->charset); }
|
| UNDERSCORE_CHARSET TEXT_STRING { $$ = new Item_string($2.str,$2.length,Lex->charset); }
|
||||||
| text_literal TEXT_STRING
|
| text_literal TEXT_STRING
|
||||||
{ ((Item_string*) $1)->append($2.str,$2.length); };
|
{ ((Item_string*) $1)->append($2.str,$2.length); };
|
||||||
|
|
||||||
text_string:
|
text_string:
|
||||||
TEXT_STRING { $$= new String($1.str,$1.length,default_charset_info); }
|
TEXT_STRING { $$= new String($1.str,$1.length,current_thd->thd_charset); }
|
||||||
| HEX_NUM
|
| HEX_NUM
|
||||||
{
|
{
|
||||||
Item *tmp = new Item_varbinary($1.str,$1.length);
|
Item *tmp = new Item_varbinary($1.str,$1.length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user