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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4826e97c
Commit
4826e97c
authored
Dec 01, 2007
by
tnurnberg@white.intern.koehntopp.de
Browse files
Options
Browse Files
Download
Plain Diff
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into mysql.com:/misc/mysql/32180/51-32180
parents
6ebd599c
7135ca0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+12
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+10
-0
sql-common/my_time.c
sql-common/my_time.c
+8
-1
No files found.
mysql-test/r/func_time.result
View file @
4826e97c
...
...
@@ -1246,6 +1246,18 @@ select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation 'concat'
set lc_time_names=en_US;
drop table t1;
select DATE_ADD('20071108181000', INTERVAL 1 DAY);
DATE_ADD('20071108181000', INTERVAL 1 DAY)
2007-11-09 18:10:00
select DATE_ADD(20071108181000, INTERVAL 1 DAY);
DATE_ADD(20071108181000, INTERVAL 1 DAY)
2007-11-09 18:10:00
select DATE_ADD('20071108', INTERVAL 1 DAY);
DATE_ADD('20071108', INTERVAL 1 DAY)
2007-11-09
select DATE_ADD(20071108, INTERVAL 1 DAY);
DATE_ADD(20071108, INTERVAL 1 DAY)
2007-11-09
End of 5.0 tests
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
...
...
mysql-test/t/func_time.test
View file @
4826e97c
...
...
@@ -766,6 +766,16 @@ select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
set
lc_time_names
=
en_US
;
drop
table
t1
;
#
# Bug#32180: DATE_ADD treats datetime numeric argument as DATE
# instead of DATETIME
#
select
DATE_ADD
(
'20071108181000'
,
INTERVAL
1
DAY
);
select
DATE_ADD
(
20071108181000
,
INTERVAL
1
DAY
);
select
DATE_ADD
(
'20071108'
,
INTERVAL
1
DAY
);
select
DATE_ADD
(
20071108
,
INTERVAL
1
DAY
);
--
echo
End
of
5.0
tests
#
...
...
sql-common/my_time.c
View file @
4826e97c
...
...
@@ -1105,9 +1105,14 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
long
part1
,
part2
;
*
was_cut
=
0
;
bzero
((
char
*
)
time_res
,
sizeof
(
*
time_res
));
time_res
->
time_type
=
MYSQL_TIMESTAMP_DATE
;
if
(
nr
==
LL
(
0
)
||
nr
>=
LL
(
10000101000000
))
{
time_res
->
time_type
=
MYSQL_TIMESTAMP_DATETIME
;
goto
ok
;
}
if
(
nr
<
101
)
goto
err
;
if
(
nr
<=
(
YY_PART_YEAR
-
1
)
*
10000L
+
1231L
)
...
...
@@ -1131,6 +1136,9 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
}
if
(
nr
<
101000000L
)
goto
err
;
time_res
->
time_type
=
MYSQL_TIMESTAMP_DATETIME
;
if
(
nr
<=
(
YY_PART_YEAR
-
1
)
*
LL
(
10000000000
)
+
LL
(
1231235959
))
{
nr
=
nr
+
LL
(
20000000000000
);
/* YYMMDDHHMMSS, 2000-2069 */
...
...
@@ -1144,7 +1152,6 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
ok:
part1
=
(
long
)
(
nr
/
LL
(
1000000
));
part2
=
(
long
)
(
nr
-
(
longlong
)
part1
*
LL
(
1000000
));
bzero
((
char
*
)
time_res
,
sizeof
(
*
time_res
));
time_res
->
year
=
(
int
)
(
part1
/
10000L
);
part1
%=
10000L
;
time_res
->
month
=
(
int
)
part1
/
100
;
time_res
->
day
=
(
int
)
part1
%
100
;
...
...
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