dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.

Home Page:http://mycli.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Defined2014 opened this issue · comments

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 root@127.0.0.1:(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 root@127.0.0.1:(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)