mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Preparation to thread specific default charset
This commit is contained in:
parent
c20b489167
commit
fef10d9bb1
4 changed files with 5 additions and 3 deletions
|
@ -108,6 +108,7 @@ THD::THD():user_time(0), fatal_error(0),
|
|||
file_id = 0;
|
||||
cond_count=0;
|
||||
db_charset=default_charset_info;
|
||||
thd_charset=default_charset_info;
|
||||
mysys_var=0;
|
||||
#ifndef DBUG_OFF
|
||||
dbug_sentry=THD_SENTRY_MAGIC;
|
||||
|
|
|
@ -481,6 +481,7 @@ public:
|
|||
table_map used_tables;
|
||||
USER_CONN *user_connect;
|
||||
CHARSET_INFO *db_charset;
|
||||
CHARSET_INFO *thd_charset;
|
||||
List <MYSQL_ERROR> warn_list;
|
||||
uint warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
|
||||
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);
|
||||
load_db_opt(path, &create);
|
||||
thd->db_charset=create.table_charset;
|
||||
|
||||
thd->thd_charset=thd->db_charset ? thd->db_charset : default_charset_info;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -3309,13 +3309,13 @@ opt_ignore_lines:
|
|||
/* Common definitions */
|
||||
|
||||
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); }
|
||||
| text_literal TEXT_STRING
|
||||
{ ((Item_string*) $1)->append($2.str,$2.length); };
|
||||
|
||||
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
|
||||
{
|
||||
Item *tmp = new Item_varbinary($1.str,$1.length);
|
||||
|
|
Loading…
Reference in a new issue