From 4474cc8493fb999b1fea4da739177c146909ddef Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Dec 2006 13:45:21 +0400 Subject: Bug#22645 LC_TIME_NAMES: Statement not replicated Problem: replication of LC_TIME_NAMES didn't work. Thus, INSERTS or UPDATES using date_format() always worked with en_US on the slave side. Fix: adding ONE_SHOT implementation for LC_TIME_NAMES. mysql-test/r/variables.result: Adding various tests with LC_TIME_NAMES and string and numeric constants and expressions. mysql-test/t/variables.test: Adding various tests with LC_TIME_NAMES and string and numeric constants and expressions. sql/log.cc: Adding ONE_SHOT trick for lc_time_names. sql/mysql_priv.h: Adding new member "number" - for unique locale IDs. Adding prototype for my_locale_by_number(). sql/set_var.cc: Modifying lc_time_names variable to understand both: - string valyes (using locale name) - number values (using locale IDs) sql/set_var.h: - Marking lc_time_names as ONE_SHOT capable. - Marking lc_time_names as INT_RESULT compatible. sql/sql_locale.cc: - adding local IDs - better layout for locale data declarations (splitting long lines into short ones) - adding DBUG_ASSERT into my_locale_by_name() and moving this function towards the end of file - after "my_locales" declaration - adding my_locale_by_number() implementation sql/sql_parse.cc: Adding initialization of lc_time_names to its default value (en_US) mysql-test/r/rpl_locale.result: Adding test case mysql-test/t/rpl_locale.test: Adding test case --- sql/set_var.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/set_var.h') diff --git a/sql/set_var.h b/sql/set_var.h index 1ae3a18111f..78b34963e9d 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -764,12 +764,16 @@ class sys_var_thd_lc_time_names :public sys_var_thd public: sys_var_thd_lc_time_names(const char *name_arg): sys_var_thd(name_arg) - {} + { +#if MYSQL_VERSION_ID < 50000 + no_support_one_shot= 0; +#endif + } bool check(THD *thd, set_var *var); SHOW_TYPE type() { return SHOW_CHAR; } bool check_update_type(Item_result type) { - return type != STRING_RESULT; /* Only accept strings */ + return ((type != STRING_RESULT) && (type != INT_RESULT)); } bool check_default(enum_var_type type) { return 0; } bool update(THD *thd, set_var *var); -- cgit v1.2.1