-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
#In TiDB
#table creation
mysql> show create table rand;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| rand | CREATE TABLE rand
(
id
int(11) DEFAULT NULL,
date_t
date DEFAULT CURRENT_DATE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> insert into rand(id) values(1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into rand values(1,'2024-06-03 00:00:00.000000');
Query OK, 1 row affected (0.01 sec)
mysql> select * from rand;
+------+------------+
| id | date_t |
+------+------------+
| 1 | 2024-06-03 |
| 1 | 2024-06-03 |
+------+------------+
2 rows in set (0.01 sec)
2. What did you expect to see? (Required)
#Behavior in MySQL
root@localhost : test 02:15:59>>> select date_t ,count() from rand group by date_t;
+------------+----------+
| date_t | count() |
+------------+----------+
| 2024-06-03 | 2 |
+------------+----------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
#Behavior in TiDB
mysql> select date_t ,count() from rand group by date_t;
+------------+----------+
| date_t | count() |
+------------+----------+
| 2024-06-03 | 1 |
| 2024-06-03 | 1 |
+------------+----------+
2 rows in set (0.00 sec)
4. What is your TiDB version? (Required)
v7.1.1