Commit fef10d9b authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

Preparation to thread specific default charset

parent c20b4891
...@@ -108,6 +108,7 @@ THD::THD():user_time(0), fatal_error(0), ...@@ -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: ...@@ -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) ...@@ -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: ...@@ -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);
......
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