You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATETABLE `t3` (
`a`date DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c`time DEFAULT NULL,
`d`timestampNULL DEFAULT NULL,
`e` year(4) DEFAULT NULL,
KEY `expression_index` ((adddate(`a`, interval 10 microsecond)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
insert into t3 values ('2021-01-02', '2021-03-30 08:10:00', '12:01:03', UTC_TIMESTAMP(), 2021);
select*from t3 use index(expression_index) where ADDDATE(a, interval 10 MICROSECOND) = ADDDATE('2021-01-02', interval 10 MICROSECOND);
select*from t3 ignore index(expression_index) where ADDDATE(a, interval 10 MICROSECOND) = ADDDATE('2021-01-02', interval 10 MICROSECOND);
2. What did you expect to see? (Required)
result should be same when use and ignore index
3. What did you see instead (Required)
MySQL root@127.0.0.1:test>select*from t3 use index(expression_index) where ADDDATE(a, interval 10 MICROSECOND) = ADDDATE('2021-01-02', interval 10 MICROSECOND);
+---+---+---+---+---+
| a | b | c | d | e |
+---+---+---+---+---+0 rows insetTime: 0.006s
MySQL root@127.0.0.1:test>select*from t3 ignore index(expression_index) where ADDDATE(a, interval 10 MICROSECOND) = ADDDATE('2021-01-02', interval 10 MICROSECOND);
+------------+---------------------+----------+---------------------+------+
| a | b | c | d | e |
+------------+---------------------+----------+---------------------+------+
| 2021-01-02 | 2021-03-3008:10:00 | 12:01:03 | 2021-08-1202:27:35 | 2021 |
+------------+---------------------+----------+---------------------+------+
4. What is your TiDB version? (Required)
MySQL root@127.0.0.1:test>select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v5.2.0-alpha-572-g6b8c15301
Edition: Community
Git Commit Hash: 6b8c1530164be17486935b3be250c8aab6072e73
Git Branch: master
UTC Build Time: 2021-08-1008:52:58
GoVersion: go1.16.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
result should be same when use and ignore index
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: