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
11ebbabb
Commit
11ebbabb
authored
Sep 01, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sec_to_time() in the integer context was losing the sign of the result
parent
26bd06fe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+4
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+2
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+2
-1
No files found.
mysql-test/r/func_time.result
View file @
11ebbabb
...
...
@@ -27,6 +27,10 @@ sec_to_time('9001.1') sec_to_time('1234567890123.123')
02:30:01.100000 838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '1234567890123.123'
select sec_to_time(-9001.1), sec_to_time(-9001.1) / 1,
sec_to_time(-9001.1) / 1e0, sec_to_time(-9001) div 1;
sec_to_time(-9001.1) sec_to_time(-9001.1) / 1 sec_to_time(-9001.1) / 1e0 sec_to_time(-9001) div 1
-02:30:01.1 -23001.10000 -23001.1 -23001
select sec_to_time(90011e-1), sec_to_time(1234567890123e30);
sec_to_time(90011e-1) sec_to_time(1234567890123e30)
02:30:01.100000 838:59:59.999999
...
...
mysql-test/t/func_time.test
View file @
11ebbabb
...
...
@@ -18,6 +18,8 @@ select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"),
select
sec_to_time
(
9001.1
),
time_to_sec
(
'15:12:22.123456'
),
time_to_sec
(
15.5566778899
);
select
sec_to_time
(
time_to_sec
(
'-838:59:59'
));
select
sec_to_time
(
'9001.1'
),
sec_to_time
(
'1234567890123.123'
);
select
sec_to_time
(
-
9001.1
),
sec_to_time
(
-
9001.1
)
/
1
,
sec_to_time
(
-
9001.1
)
/
1
e0
,
sec_to_time
(
-
9001
)
div
1
;
--
replace_result
e
+
042
e
+
42
select
sec_to_time
(
90011
e
-
1
),
sec_to_time
(
1234567890123
e30
);
select
sec_to_time
(
1234567890123
),
sec_to_time
(
'99999999999999999999999999999'
);
...
...
sql/item_timefunc.cc
View file @
11ebbabb
...
...
@@ -1370,7 +1370,8 @@ longlong Item_temporal_func::val_int()
MYSQL_TIME
ltime
;
if
(
get_date
(
&
ltime
,
TIME_FUZZY_DATE
))
return
0
;
return
(
longlong
)
TIME_to_ulonglong
(
&
ltime
);
longlong
v
=
TIME_to_ulonglong
(
&
ltime
);
return
ltime
.
neg
?
-
v
:
v
;
}
...
...
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