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
a4e59020
Commit
a4e59020
authored
Sep 28, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
parent
c5922c57
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-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
+8
-0
sql/item_func.cc
sql/item_func.cc
+3
-1
No files found.
mysql-test/r/type_time.result
View file @
a4e59020
...
@@ -1206,5 +1206,14 @@ Warning 1292 Incorrect time value: '9000000' for column 'b' at row 4
...
@@ -1206,5 +1206,14 @@ Warning 1292 Incorrect time value: '9000000' for column 'b' at row 4
Warning 1292 Incorrect time value: '9000000' for column 'c' at row 4
Warning 1292 Incorrect time value: '9000000' for column 'c' at row 4
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
#
CREATE TABLE t1 (a TIME);
INSERT INTO t1 VALUES ('10:10:10'),('10:20:30');
SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
MAX(a) MAX(COALESCE(a))
10:20:30 10:20:30
DROP TABLE t1;
#
# End of 10.1 tests
# End of 10.1 tests
#
#
mysql-test/t/type_time.test
View file @
a4e59020
...
@@ -715,6 +715,14 @@ INSERT INTO t1 VALUES (9000000,9000000,9000000);
...
@@ -715,6 +715,14 @@ INSERT INTO t1 VALUES (9000000,9000000,9000000);
SELECT
a
,
TIME
(
a
),
TIME
(
b
),
TIME
(
c
)
FROM
t1
ORDER
BY
a
;
SELECT
a
,
TIME
(
a
),
TIME
(
b
),
TIME
(
c
)
FROM
t1
ORDER
BY
a
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
--
echo
#
CREATE
TABLE
t1
(
a
TIME
);
INSERT
INTO
t1
VALUES
(
'10:10:10'
),(
'10:20:30'
);
SELECT
MAX
(
a
),
MAX
(
COALESCE
(
a
))
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
#
--
echo
# End of 10.1 tests
--
echo
# End of 10.1 tests
--
echo
#
--
echo
#
sql/item_func.cc
View file @
a4e59020
...
@@ -1089,7 +1089,9 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime,
...
@@ -1089,7 +1089,9 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime,
case
STRING_RESULT
:
case
STRING_RESULT
:
{
{
if
(
is_temporal_type
(
field_type
()))
if
(
is_temporal_type
(
field_type
()))
return
date_op
(
ltime
,
fuzzydate
);
return
date_op
(
ltime
,
fuzzydate
|
(
field_type
()
==
MYSQL_TYPE_TIME
?
TIME_TIME_ONLY
:
0
));
char
buff
[
40
];
char
buff
[
40
];
String
tmp
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
),
*
res
;
String
tmp
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
),
*
res
;
if
(
!
(
res
=
str_op
(
&
tmp
))
||
if
(
!
(
res
=
str_op
(
&
tmp
))
||
...
...
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