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
f1b4718e
Commit
f1b4718e
authored
Aug 12, 2013
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00'))
parent
04fd2f18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
mysql-test/r/type_time.result
mysql-test/r/type_time.result
+9
-0
mysql-test/t/type_time.test
mysql-test/t/type_time.test
+6
-0
sql/item.cc
sql/item.cc
+2
-1
sql/item_func.cc
sql/item_func.cc
+7
-0
No files found.
mysql-test/r/type_time.result
View file @
f1b4718e
...
...
@@ -182,5 +182,14 @@ NULL
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
#
# MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
#
SELECT CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')));
CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
00:00:01.000000
SELECT CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00')));
CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00')))
768:00:01.000000
#
# End of 5.3 tests
#
mysql-test/t/type_time.test
View file @
f1b4718e
...
...
@@ -128,6 +128,12 @@ drop table t1;
--
echo
#
SELECT
CONVERT_TZ
(
GREATEST
(
TIME
(
'00:00:00'
),
TIME
(
'00:00:00'
)),
'+00:00'
,
'+7:5'
);
--
echo
#
--
echo
# MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
--
echo
#
SELECT
CONCAT
(
GREATEST
(
TIME
(
'00:00:01'
),
TIME
(
'00:00:00'
)));
SELECT
CONCAT
(
GREATEST
(
TIME
(
'32 00:00:01'
),
TIME
(
'00:00:00'
)));
--
echo
#
--
echo
# End of 5.3 tests
--
echo
#
sql/item.cc
View file @
f1b4718e
...
...
@@ -252,7 +252,8 @@ String *Item::val_string_from_decimal(String *str)
String
*
Item
::
val_string_from_date
(
String
*
str
)
{
MYSQL_TIME
ltime
;
if
(
get_date
(
&
ltime
,
0
)
||
if
(
get_date
(
&
ltime
,
field_type
()
==
MYSQL_TYPE_TIME
?
TIME_TIME_ONLY
:
0
)
||
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
null_value
=
1
;
...
...
sql/item_func.cc
View file @
f1b4718e
...
...
@@ -2480,6 +2480,13 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
ltime
->
time_type
=
MYSQL_TIMESTAMP_DATE
;
ltime
->
hour
=
ltime
->
minute
=
ltime
->
second
=
ltime
->
second_part
=
0
;
}
else
if
(
compare_as_dates
->
field_type
()
==
MYSQL_TYPE_TIME
)
{
ltime
->
time_type
=
MYSQL_TIMESTAMP_TIME
;
ltime
->
hour
+=
(
ltime
->
month
*
32
+
ltime
->
day
)
*
24
;
ltime
->
month
=
ltime
->
day
=
0
;
}
return
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