Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5068ebc1
Commit
5068ebc1
authored
Aug 06, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B29536-5.0-opt
parents
b8e85da3
117c3ff9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
6 deletions
+49
-6
mysql-test/r/rpl_timezone.result
mysql-test/r/rpl_timezone.result
+18
-0
mysql-test/t/rpl_timezone.test
mysql-test/t/rpl_timezone.test
+27
-2
sql/field.cc
sql/field.cc
+3
-3
sql/time.cc
sql/time.cc
+1
-1
No files found.
mysql-test/r/rpl_timezone.result
View file @
5068ebc1
...
...
@@ -130,3 +130,21 @@ t
2005-01-01 08:00:00
drop table t1, t2;
set global time_zone= @my_time_zone;
End of 4.1 tests
CREATE TABLE t1 (a INT, b TIMESTAMP);
INSERT INTO t1 VALUES (1, NOW());
SET @@session.time_zone='Japan';
UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1;
Warnings:
Warning 1264 Out of range value adjusted for column 'b' at row 1
SELECT * FROM t1 ORDER BY a;
a b
1 0000-00-00 00:00:00
SET @@session.time_zone='Japan';
SELECT * FROM t1 ORDER BY a;
a b
1 0000-00-00 00:00:00
SET @@session.time_zone = default;
DROP TABLE t1;
SET @@session.time_zone = default;
End of 5.0 tests
mysql-test/t/rpl_timezone.test
View file @
5068ebc1
...
...
@@ -126,8 +126,33 @@ connection master;
drop
table
t1
,
t2
;
sync_slave_with_master
;
# End of 4.1 tests
# Restore original timezone
connection
master
;
set
global
time_zone
=
@
my_time_zone
;
--
echo
End
of
4.1
tests
#
# Bug #29536: timestamp inconsistent in replication around 1970
#
connection
master
;
CREATE
TABLE
t1
(
a
INT
,
b
TIMESTAMP
);
INSERT
INTO
t1
VALUES
(
1
,
NOW
());
SET
@@
session
.
time_zone
=
'Japan'
;
UPDATE
t1
SET
b
=
'1970-01-01 08:59:59'
WHERE
a
=
1
;
SELECT
*
FROM
t1
ORDER
BY
a
;
sync_slave_with_master
;
SET
@@
session
.
time_zone
=
'Japan'
;
# must procdure the same result as the SELECT on the master
SELECT
*
FROM
t1
ORDER
BY
a
;
SET
@@
session
.
time_zone
=
default
;
connection
master
;
DROP
TABLE
t1
;
SET
@@
session
.
time_zone
=
default
;
--
echo
End
of
5.0
tests
sql/field.cc
View file @
5068ebc1
...
...
@@ -4462,6 +4462,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
);
...
...
@@ -4473,7 +4474,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
+
...
...
@@ -4492,6 +4492,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
);
...
...
@@ -4507,7 +4508,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
)
...
...
@@ -4557,6 +4557,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
);
...
...
@@ -4572,7 +4573,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
;
}
...
...
sql/time.cc
View file @
5068ebc1
...
...
@@ -228,11 +228,11 @@ my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *in_dst_time_
my_time_t
timestamp
;
*
in_dst_time_gap
=
0
;
thd
->
time_zone_used
=
1
;
timestamp
=
thd
->
variables
.
time_zone
->
TIME_to_gmt_sec
(
t
,
in_dst_time_gap
);
if
(
timestamp
)
{
thd
->
time_zone_used
=
1
;
return
timestamp
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment