Skip to content

the function of timediff has errors in boundary and type #1570

@manannan2017

Description

@manannan2017

the function of timediff has errors,such as boundary and type

the list of errors is:
1、select timediff(CAST('1944-02-25 00:00:00' as datetime), CAST('1944-2-26' as datetime));
+----------------------------------------------------------------------------------+
| timediff(CAST('1944-02-25 00:00:00' AS DATETIME), CAST('1944-2-26' AS DATETIME)) |
+----------------------------------------------------------------------------------+
| 00:00:00 |
+----------------------------------------------------------------------------------+
except:
+----------------------------------------------------------------------------------+
| timediff(CAST('1944-02-25 00:00:00' as datetime), CAST('1944-2-26' as datetime)) |
+----------------------------------------------------------------------------------+
| -24:00:00 |
+----------------------------------------------------------------------------------+
1 row in set (0.47 sec)

2、boundary
SELECT TIMEDIFF('2019-01-01 00:00:00', '2009-01-01 00:00:00');
+--------------------------------------------------------+
| timediff('2019-01-01 00:00:00', '2009-01-01 00:00:00') |
+--------------------------------------------------------+
| 87648:00:00 |
+---------------------------
except:
SELECT TIMEDIFF('2019-01-01 00:00:00', '2009-01-01 00:00:00');
+--------------------------------------------------------+
| TIMEDIFF('2019-01-01 00:00:00', '2009-01-01 00:00:00') |
+--------------------------------------------------------+
| 838:59:59 |
+--------------------------------------------------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions