Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Defined2014 opened this issue Apr 28, 2023 · 0 comments

Comments

@Defined2014
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant