Commit f72d05d6 authored by unknown's avatar unknown

Fix for bug#11775 Variable character_set_system does not exist (sometimes).

  Variable character_set_system is selectable now
  More accurate error message results during 
  update of character_set_system and some other read only variables


mysql-test/r/variables.result:
  Fix for bug#11775 Variable character_set_system does not exist (sometimes).
    test case
mysql-test/t/variables.test:
  Fix for bug#11775 Variable character_set_system does not exist (sometimes).
    test case
parent 8fb5394b
...@@ -545,3 +545,10 @@ select @@max_heap_table_size > 0; ...@@ -545,3 +545,10 @@ select @@max_heap_table_size > 0;
select @@have_innodb; select @@have_innodb;
@@have_innodb @@have_innodb
# #
select @@character_set_system;
@@character_set_system
utf8
set global character_set_system = latin1;
ERROR HY000: Variable 'character_set_system' is a read only variable
set @@global.version_compile_os='234';
ERROR HY000: Variable 'version_compile_os' is a read only variable
...@@ -435,3 +435,12 @@ select @@max_heap_table_size > 0; ...@@ -435,3 +435,12 @@ select @@max_heap_table_size > 0;
--replace_column 1 # --replace_column 1 #
select @@have_innodb; select @@have_innodb;
#
# Bug #11775 Variable character_set_system does not exist (sometimes)
#
select @@character_set_system;
--error 1238
set global character_set_system = latin1;
--error 1238
set @@global.version_compile_os='234';
...@@ -142,11 +142,8 @@ sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size", ...@@ -142,11 +142,8 @@ sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size",
sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size", sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size",
&SV::bulk_insert_buff_size); &SV::bulk_insert_buff_size);
sys_var_character_set_server sys_character_set_server("character_set_server"); sys_var_character_set_server sys_character_set_server("character_set_server");
sys_var_str sys_charset_system("character_set_system", sys_var_const_str sys_charset_system("character_set_system",
sys_check_charset, (char *)my_charset_utf8_general_ci.name);
sys_update_charset,
sys_set_default_charset,
(char *)my_charset_utf8_general_ci.name);
sys_var_character_set_database sys_character_set_database("character_set_database"); sys_var_character_set_database sys_character_set_database("character_set_database");
sys_var_character_set_client sys_character_set_client("character_set_client"); sys_var_character_set_client sys_character_set_client("character_set_client");
sys_var_character_set_connection sys_character_set_connection("character_set_connection"); sys_var_character_set_connection sys_character_set_connection("character_set_connection");
...@@ -569,6 +566,7 @@ sys_var *sys_variables[]= ...@@ -569,6 +566,7 @@ sys_var *sys_variables[]=
&sys_character_set_client, &sys_character_set_client,
&sys_character_set_connection, &sys_character_set_connection,
&sys_character_set_results, &sys_character_set_results,
&sys_charset_system,
&sys_collation_connection, &sys_collation_connection,
&sys_collation_database, &sys_collation_database,
&sys_collation_server, &sys_collation_server,
...@@ -1117,27 +1115,6 @@ static void sys_default_ftb_syntax(THD *thd, enum_var_type type) ...@@ -1117,27 +1115,6 @@ static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
sizeof(ft_boolean_syntax)-1); sizeof(ft_boolean_syntax)-1);
} }
/*
The following 3 functions need to be changed in 4.1 when we allow
one to change character sets
*/
static int sys_check_charset(THD *thd, set_var *var)
{
return 0;
}
static bool sys_update_charset(THD *thd, set_var *var)
{
return 0;
}
static void sys_set_default_charset(THD *thd, enum_var_type type)
{
}
/* /*
If one sets the LOW_PRIORIY UPDATES flag, we also must change the If one sets the LOW_PRIORIY UPDATES flag, we also must change the
......
...@@ -190,6 +190,7 @@ class sys_var_const_str :public sys_var ...@@ -190,6 +190,7 @@ class sys_var_const_str :public sys_var
return 1; return 1;
} }
bool check_default(enum_var_type type) { return 1; } bool check_default(enum_var_type type) { return 1; }
bool is_readonly() const { return 1; }
}; };
...@@ -900,7 +901,7 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list); ...@@ -900,7 +901,7 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list);
bool not_all_support_one_shot(List<set_var_base> *var_list); bool not_all_support_one_shot(List<set_var_base> *var_list);
void fix_delay_key_write(THD *thd, enum_var_type type); void fix_delay_key_write(THD *thd, enum_var_type type);
ulong fix_sql_mode(ulong sql_mode); ulong fix_sql_mode(ulong sql_mode);
extern sys_var_str sys_charset_system; extern sys_var_const_str sys_charset_system;
extern sys_var_str sys_init_connect; extern sys_var_str sys_init_connect;
extern sys_var_str sys_init_slave; extern sys_var_str sys_init_slave;
extern sys_var_thd_time_zone sys_time_zone; extern sys_var_thd_time_zone sys_time_zone;
......
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