summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com/bar.intranet.mysql.r18.ru>2006-12-05 13:45:21 +0400
committerunknown <bar@mysql.com/bar.intranet.mysql.r18.ru>2006-12-05 13:45:21 +0400
commit4474cc8493fb999b1fea4da739177c146909ddef (patch)
tree3c3f0a63ce5f3cc7e3fdbeb1a7644ca2467b750a /sql/log.cc
parent248ab7c7eeede27c7750c5c309deb57c13952dde (diff)
downloadmariadb-git-4474cc8493fb999b1fea4da739177c146909ddef.tar.gz
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
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 7e97bfd0712..b91ec2b3dee 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1350,6 +1350,21 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
if (e.write(file))
goto err;
}
+ /*
+ Use the same ONE_SHOT trick for making replication of lc_time_names.
+ */
+ if (thd->variables.lc_time_names->number) // Not en_US
+ {
+ char buf[32];
+ uint length= my_snprintf(buf, sizeof(buf),
+ "SET ONE_SHOT LC_TIME_NAMES=%u",
+ (uint) thd->variables.lc_time_names->number);
+ Query_log_event e(thd, buf, length, 0, FALSE);
+ e.set_log_pos(this);
+ e.error_code= 0; // This statement cannot fail (see [1]).
+ if (e.write(file))
+ goto err;
+ }
#endif
if (thd->last_insert_id_used)