summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-08-27 12:33:57 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-08-27 12:33:57 +0300
commitaf9f7a239ec23b8a503174e6703c0a7fe195cbfe (patch)
tree84e913bacf24682c8f33cfa007aa57a3c2ee505f /sql/field.cc
parent9b49c3cb71aab59d6829f63a8dee596d678e6814 (diff)
downloadmariadb-git-af9f7a239ec23b8a503174e6703c0a7fe195cbfe.tar.gz
re-push of Bug 29536 for 5.1.22: timestamp inconsistent in replication around 1970
MySQL replicates the time zone only when operations that involve it are performed. This is controlled by a flag. But this flag is set only on successful operation. The flag must be set also when there is an error that involves a timezone (so the master would replicate the error to the slaves). mysql-test/suite/rpl/r/rpl_timezone.result: repush of Bug 29536 for 5.1.22 tree: test case mysql-test/suite/rpl/t/rpl_timezone.test: repush of Bug 29536 for 5.1.22 tree: test case sql/field.cc: re-push of Bug 29536 for 5.1.22: move setting of the flag before the operation (so it apples to errors as well). sql/time.cc: re-push of Bug 29536 for 5.1.22: move setting of the flag before the operation (so it apples to errors as well).
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 49ffc6a252e..23dca96164e 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4655,6 +4655,7 @@ longlong Field_timestamp::val_int(void)
MYSQL_TIME time_tmp;
THD *thd= table ? table->in_use : current_thd;
+ thd->time_zone_used= 1;
#ifdef WORDS_BIGENDIAN
if (table && table->s->db_low_byte_first)
temp=uint4korr(ptr);
@@ -4666,7 +4667,6 @@ longlong Field_timestamp::val_int(void)
return(0); /* purecov: inspected */
thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, (my_time_t)temp);
- thd->time_zone_used= 1;
return time_tmp.year * LL(10000000000) + time_tmp.month * LL(100000000) +
time_tmp.day * 1000000L + time_tmp.hour * 10000L +
@@ -4686,6 +4686,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
to= (char*) val_buffer->ptr();
val_buffer->length(field_length);
+ thd->time_zone_used= 1;
#ifdef WORDS_BIGENDIAN
if (table && table->s->db_low_byte_first)
temp=uint4korr(ptr);
@@ -4701,7 +4702,6 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
val_buffer->set_charset(&my_charset_bin); // Safety
thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp,(my_time_t)temp);
- thd->time_zone_used= 1;
temp= time_tmp.year % 100;
if (temp < YY_PART_YEAR - 1)
@@ -4751,6 +4751,7 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate)
{
long temp;
THD *thd= table ? table->in_use : current_thd;
+ thd->time_zone_used= 1;
#ifdef WORDS_BIGENDIAN
if (table && table->s->db_low_byte_first)
temp=uint4korr(ptr);
@@ -4766,7 +4767,6 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate)
else
{
thd->variables.time_zone->gmt_sec_to_TIME(ltime, (my_time_t)temp);
- thd->time_zone_used= 1;
}
return 0;
}