Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
None
Description
This query returns bad results:
SELECT
|
GREATEST('2010-01-01 10:10:10',TIME('-20:20:20')), |
GREATEST('2010-01-01 10:10:10',TIME('20:20:20')), |
LEAST('2010-01-01 10:10:10',TIME('-20:20:20')), |
LEAST('2010-01-01 10:10:10',TIME('20:20:20'))\G |
GREATEST('2010-01-01 10:10:10',TIME('-20:20:20')): 802:10:10.000000
|
GREATEST('2010-01-01 10:10:10',TIME('20:20:20')): 802:10:10.000000
|
LEAST('2010-01-01 10:10:10',TIME('-20:20:20')): -20:20:20.000000
|
LEAST('2010-01-01 10:10:10',TIME('20:20:20')): 20:20:20.000000
|
Implicit conversion from the string literal '2010-01-01 10:10:10' to TIME does not seem to work well inside LEAST/GREATEST.
The expected behavior would be to return results similar to this query (with explicit CAST added around the string):
SELECT
|
GREATEST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('-20:20:20')), |
GREATEST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('20:20:20')), |
LEAST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('-20:20:20')), |
LEAST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('20:20:20'))\G |
GREATEST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('-20:20:20')): 10:10:10.000000
|
GREATEST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('20:20:20')): 20:20:20.000000
|
LEAST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('-20:20:20')): -20:20:20.000000
|
LEAST(CAST('2010-01-01 10:10:10' AS TIME(6)),TIME('20:20:20')): 10:10:10.000000
|
Attachments
Issue Links
- blocks
-
MDEV-8894 Inserting fractional seconds into MySQL 5.6 master breaks consistency on MariaDB 10 slave
- Closed