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
7319ef4e
Commit
7319ef4e
authored
May 17, 2006
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #16327: invalid TIMESTAMP values retrieved
parent
713d17d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+7
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+10
-0
sql/field.cc
sql/field.cc
+1
-1
No files found.
mysql-test/r/func_time.result
View file @
7319ef4e
...
...
@@ -630,3 +630,10 @@ select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
monthname(str_to_date(null, '%m')) monthname(str_to_date(null, '%m')) monthname(str_to_date(1, '%m')) monthname(str_to_date(0, '%m'))
NULL NULL January NULL
set time_zone='-6:00';
create table t1(a timestamp);
insert into t1 values (19691231190001);
select * from t1;
a
1969-12-31 19:00:01
drop table t1;
mysql-test/t/func_time.test
View file @
7319ef4e
...
...
@@ -322,4 +322,14 @@ select last_day('2005-01-00');
select
monthname
(
str_to_date
(
null
,
'%m'
)),
monthname
(
str_to_date
(
null
,
'%m'
)),
monthname
(
str_to_date
(
1
,
'%m'
)),
monthname
(
str_to_date
(
0
,
'%m'
));
#
# Bug #16327: problem with timestamp < 1970
#
set
time_zone
=
'-6:00'
;
create
table
t1
(
a
timestamp
);
insert
into
t1
values
(
19691231190001
);
select
*
from
t1
;
drop
table
t1
;
# End of 4.1 tests
sql/field.cc
View file @
7319ef4e
...
...
@@ -3809,7 +3809,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
thd
->
time_zone_used
=
1
;
temp
=
time_tmp
.
year
%
100
;
if
(
temp
<
YY_PART_YEAR
)
if
(
temp
<
YY_PART_YEAR
-
1
)
{
*
to
++=
'2'
;
*
to
++=
'0'
;
...
...
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