tidb
tidb copied to clipboard
Behavior of UTC_DATE() is different from mysql
Please answer these questions before submitting your issue. Thanks!
- What did you do? If possible, provide a recipe for reproducing the error.
select UTC_DATE();
select UTC_DATE() + 2;
- What did you expect to see?
mysql> select UTC_DATE();
+------------+
| UTC_DATE() |
+------------+
| 2017-08-22 |
+------------+
1 row in set (0.00 sec)
mysql> select UTC_DATE() + 2;
+----------------+
| UTC_DATE() + 2 |
+----------------+
| 20170824 |
+----------------+
1 row in set (0.00 sec)
- What did you see instead?
MySQL [(none)]> select UTC_DATE();
+------------+
| UTC_DATE() |
+------------+
| 2017-08-22 |
+------------+
1 row in set (0.00 sec)
MySQL [(none)]> select UTC_DATE() + 2;
+----------------+
| UTC_DATE() + 2 |
+----------------+
| 2019 |
+----------------+
1 row in set, 1 warning (0.00 sec)
- What version of TiDB are you using (
tidb-server -V)? Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad Git Commit Branch: master UTC Build Time: 2017-08-16 01:24:27
@tshqin Thanks! @tiancaiamao @XuHuaiyu PTAL
fixed after rewriting function UTC_DATE() in this pr #4206