Commit 2e302abc authored by unknown's avatar unknown

Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl

into  mysql.com:/home/bar/mysql-5.0.b22648

parents 33ac50f0 8e2b68c3
...@@ -637,6 +637,37 @@ set lc_time_names=0; ...@@ -637,6 +637,37 @@ set lc_time_names=0;
select @@lc_time_names; select @@lc_time_names;
@@lc_time_names @@lc_time_names
en_US en_US
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
en_US en_US
set @@global.lc_time_names=fr_FR;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR en_US
New connection
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR fr_FR
set @@lc_time_names=ru_RU;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR ru_RU
Returnung to default connection
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR en_US
set lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR fr_FR
set @@global.lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
en_US fr_FR
set @@lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
en_US en_US
set @test = @@query_prealloc_size; set @test = @@query_prealloc_size;
set @@query_prealloc_size = @test; set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test; select @@query_prealloc_size = @test;
......
...@@ -504,6 +504,30 @@ select @@lc_time_names; ...@@ -504,6 +504,30 @@ select @@lc_time_names;
set lc_time_names=0; set lc_time_names=0;
select @@lc_time_names; select @@lc_time_names;
#
# Bug #22648 LC_TIME_NAMES: Setting GLOBAL has no effect
#
select @@global.lc_time_names, @@lc_time_names;
set @@global.lc_time_names=fr_FR;
select @@global.lc_time_names, @@lc_time_names;
--echo New connection
connect (con1,localhost,root,,);
connection con1;
select @@global.lc_time_names, @@lc_time_names;
set @@lc_time_names=ru_RU;
select @@global.lc_time_names, @@lc_time_names;
disconnect con1;
connection default;
--echo Returnung to default connection
select @@global.lc_time_names, @@lc_time_names;
set lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
set @@global.lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
set @@lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
# #
# Bug #13334: query_prealloc_size default less than minimum # Bug #13334: query_prealloc_size default less than minimum
# #
......
...@@ -149,6 +149,7 @@ typedef struct my_locale_st ...@@ -149,6 +149,7 @@ typedef struct my_locale_st
extern MY_LOCALE my_locale_en_US; extern MY_LOCALE my_locale_en_US;
extern MY_LOCALE *my_locales[]; extern MY_LOCALE *my_locales[];
extern MY_LOCALE *my_default_lc_time_names;
MY_LOCALE *my_locale_by_name(const char *name); MY_LOCALE *my_locale_by_name(const char *name);
MY_LOCALE *my_locale_by_number(uint number); MY_LOCALE *my_locale_by_number(uint number);
......
...@@ -315,6 +315,7 @@ static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr; ...@@ -315,6 +315,7 @@ static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr;
static char *opt_init_slave, *language_ptr, *opt_init_connect; static char *opt_init_slave, *language_ptr, *opt_init_connect;
static char *default_character_set_name; static char *default_character_set_name;
static char *character_set_filesystem_name; static char *character_set_filesystem_name;
static char *lc_time_names_name;
static char *my_bind_addr_str; static char *my_bind_addr_str;
static char *default_collation_name; static char *default_collation_name;
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME; static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
...@@ -495,6 +496,8 @@ CHARSET_INFO *system_charset_info, *files_charset_info ; ...@@ -495,6 +496,8 @@ CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset; CHARSET_INFO *national_charset_info, *table_alias_charset;
CHARSET_INFO *character_set_filesystem; CHARSET_INFO *character_set_filesystem;
MY_LOCALE *my_default_lc_time_names;
SHOW_COMP_OPTION have_isam; SHOW_COMP_OPTION have_isam;
SHOW_COMP_OPTION have_raid, have_ssl, have_symlink, have_query_cache; SHOW_COMP_OPTION have_raid, have_ssl, have_symlink, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys, have_dlopen; SHOW_COMP_OPTION have_geometry, have_rtree_keys, have_dlopen;
...@@ -2826,6 +2829,14 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -2826,6 +2829,14 @@ static int init_common_variables(const char *conf_file_name, int argc,
return 1; return 1;
global_system_variables.character_set_filesystem= character_set_filesystem; global_system_variables.character_set_filesystem= character_set_filesystem;
if (!(my_default_lc_time_names=
my_locale_by_name(lc_time_names_name)))
{
sql_print_error("Unknown locale: '%s'", MYF(0), lc_time_names_name);
return 1;
}
global_system_variables.lc_time_names= my_default_lc_time_names;
sys_init_connect.value_length= 0; sys_init_connect.value_length= 0;
if ((sys_init_connect.value= opt_init_connect)) if ((sys_init_connect.value= opt_init_connect))
sys_init_connect.value_length= strlen(opt_init_connect); sys_init_connect.value_length= strlen(opt_init_connect);
...@@ -4749,6 +4760,7 @@ enum options_mysqld ...@@ -4749,6 +4760,7 @@ enum options_mysqld
OPT_DEFAULT_COLLATION, OPT_DEFAULT_COLLATION,
OPT_CHARACTER_SET_CLIENT_HANDSHAKE, OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
OPT_CHARACTER_SET_FILESYSTEM, OPT_CHARACTER_SET_FILESYSTEM,
OPT_LC_TIME_NAMES,
OPT_INIT_CONNECT, OPT_INIT_CONNECT,
OPT_INIT_SLAVE, OPT_INIT_SLAVE,
OPT_SECURE_AUTH, OPT_SECURE_AUTH,
...@@ -5078,6 +5090,11 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, ...@@ -5078,6 +5090,11 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
"Client error messages in given language. May be given as a full path.", "Client error messages in given language. May be given as a full path.",
(gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG, (gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"lc-time-names", OPT_LC_TIME_NAMES,
"Set the language used for the month names and the days of the week.",
(gptr*) &lc_time_names_name,
(gptr*) &lc_time_names_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"local-infile", OPT_LOCAL_INFILE, {"local-infile", OPT_LOCAL_INFILE,
"Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).", "Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).",
(gptr*) &opt_local_infile, (gptr*) &opt_local_infile,
...@@ -6552,7 +6569,7 @@ static void mysql_init_variables(void) ...@@ -6552,7 +6569,7 @@ static void mysql_init_variables(void)
default_collation_name= compiled_default_collation_name; default_collation_name= compiled_default_collation_name;
sys_charset_system.value= (char*) system_charset_info->csname; sys_charset_system.value= (char*) system_charset_info->csname;
character_set_filesystem_name= (char*) "binary"; character_set_filesystem_name= (char*) "binary";
lc_time_names_name= (char*) "en_US";
/* Set default values for some option variables */ /* Set default values for some option variables */
global_system_variables.table_type= DB_TYPE_MYISAM; global_system_variables.table_type= DB_TYPE_MYISAM;
......
...@@ -2825,7 +2825,10 @@ bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var) ...@@ -2825,7 +2825,10 @@ bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var)
bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var) bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
{ {
thd->variables.lc_time_names= var->save_result.locale_value; if (var->type == OPT_GLOBAL)
global_system_variables.lc_time_names= var->save_result.locale_value;
else
thd->variables.lc_time_names= var->save_result.locale_value;
return 0; return 0;
} }
...@@ -2833,13 +2836,18 @@ bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var) ...@@ -2833,13 +2836,18 @@ bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
byte *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type, byte *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base) LEX_STRING *base)
{ {
return (byte *)(thd->variables.lc_time_names->name); return type == OPT_GLOBAL ?
(byte *) global_system_variables.lc_time_names->name :
(byte *) thd->variables.lc_time_names->name;
} }
void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type) void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
{ {
thd->variables.lc_time_names = &my_locale_en_US; if (type == OPT_GLOBAL)
global_system_variables.lc_time_names= my_default_lc_time_names;
else
thd->variables.lc_time_names= global_system_variables.lc_time_names;
} }
/* /*
......
...@@ -343,7 +343,6 @@ void THD::init(void) ...@@ -343,7 +343,6 @@ void THD::init(void)
total_warn_count= 0; total_warn_count= 0;
update_charset(); update_charset();
bzero((char *) &status_var, sizeof(status_var)); bzero((char *) &status_var, sizeof(status_var));
variables.lc_time_names = &my_locale_en_US;
} }
......
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