Skip to content

The result with mycli and mysql-client is different for timediff builtin func #1113

@Defined2014

Description

@Defined2014

Tried mycli and mysql-client with MySQL 8.0.28, the result is different.

mycli

➜  tidb-x git:(remote_pid) ✗ mycli --host  127.0.0.1  --port 3306 -u root
MySQL
mycli 1.26.1
Home: http://mycli.net
Bug tracker: https://github.com/dbcli/mycli/issues
Thanks to the contributor - Jonathan Slenders
MySQL [email protected]:(none)> select timediff('2020-11-11 01:01:01', '2020-11-11 01:02:01');
+--------------------------------------------------------+
| timediff('2020-11-11 01:01:01', '2020-11-11 01:02:01') |
+--------------------------------------------------------+
| -1 day, 23:59:00                                       |
+--------------------------------------------------------+

1 row in set
Time: 0.010s
MySQL [email protected]:(none)> select version();
+-----------+
| version() |
+-----------+
| 8.0.28    |
+-----------+

mysql

➜  tidb-x git:(remote_pid) ✗ mysql --host  127.0.0.1  --port 3306 -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.28 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select timediff('2020-11-11 01:01:01', '2020-11-11 01:02:01');
+--------------------------------------------------------+
| timediff('2020-11-11 01:01:01', '2020-11-11 01:02:01') |
+--------------------------------------------------------+
| -00:01:00                                              |
+--------------------------------------------------------+
1 row in set (0.00 sec)

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