mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 14:15:33 +02:00
Bug #37339: SHOW VARIABLES not working properly with multi-byte datadir
The SHOW VARIABLES LIKE .../SELECT @@/SELECT ... FROM INFORMATION_SCHEMA.VARIABLES were assuming that all the system variables are in system charset (UTF-8). However the variables that are settable through command line will have a different character set (character_set_filesystem). Fixed the server to remember the correct character set of basedir, datadir, tmpdir, ssl, plugin_dir, slave_load_tmpdir, innodb variables; init_connect and init_slave variables and use it when processing data. mysql-test/r/ctype_filesystem.result: Bug #37339: test case (should be in utf-8) mysql-test/t/ctype_filesystem-master.opt: Bug #37339: test case (should be in ISO-8859-1) mysql-test/t/ctype_filesystem.test: Bug #37339: test case sql/mysqld.cc: Bug #37339: remember the correct character set for init_slave and init_connect sql/set_var.cc: Bug #37339: - remember the character set of the relevant variables - implement storing and using the correct character set sql/set_var.h: Bug #37339: implement storing and using the correct character set sql/sql_show.cc: Bug #37339: implement storing and using the correct character set
This commit is contained in:
parent
380f1a8440
commit
8e688a7a02
7 changed files with 116 additions and 28 deletions
|
|
@ -1441,6 +1441,7 @@ static bool show_status_array(THD *thd, const char *wild,
|
|||
char name_buffer[80];
|
||||
int len;
|
||||
LEX_STRING null_lex_str;
|
||||
CHARSET_INFO *charset= system_charset_info;
|
||||
DBUG_ENTER("show_status_array");
|
||||
|
||||
null_lex_str.str= 0; // For sys_var->value_ptr()
|
||||
|
|
@ -1469,9 +1470,10 @@ static bool show_status_array(THD *thd, const char *wild,
|
|||
long nr;
|
||||
if (show_type == SHOW_SYS)
|
||||
{
|
||||
show_type= ((sys_var*) value)->show_type();
|
||||
value= (char*) ((sys_var*) value)->value_ptr(thd, value_type,
|
||||
&null_lex_str);
|
||||
sys_var *var= ((sys_var *) value);
|
||||
show_type= var->show_type();
|
||||
value= (char*) var->value_ptr(thd, value_type, &null_lex_str);
|
||||
charset= var->charset(thd);
|
||||
}
|
||||
|
||||
pos= end= buff;
|
||||
|
|
@ -1794,7 +1796,7 @@ static bool show_status_array(THD *thd, const char *wild,
|
|||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(name_buffer, strlen(name_buffer),
|
||||
system_charset_info);
|
||||
table->field[1]->store(pos, (uint32) (end - pos), system_charset_info);
|
||||
table->field[1]->store(pos, (uint32) (end - pos), charset);
|
||||
if (schema_table_store_record(thd, table))
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue