pingcap / pingcap/tidb

Inconsistent Result/Error from Tiflash

Open
#57,466 4 comments 1 reaction 0 assignees View on GitHub
affects-8.4 impact/inconsistency may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/moderate sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

```sql
CREATE TABLE `t1` (
`col1` varchar(255) NOT NULL,
`col2` timestamp NOT NULL DEFAULT '2024-11-17 00:00:00',
PRIMARY KEY (`col1`,`col2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

INSERT INTO `t1` VALUES
('qweasd','2001-01-09 00:00:00'),
('qwasdxzr','1949-03-02 00:00:00');

ALTER TABLE t1 SET TIFLASH REPLICA 1;

SELECT /*+ READ_FROM_STORAGE(TIKV[`t1`])*/ MAX(`col1`) AS `r2`
FROM `t1` WHERE `col2` IN ('1888-08-15', '1888-05-14') GROUP BY `col2`
HAVING `col2` <= '2022-03-22';

SELECT /*+ READ_FROM_STORAGE(TIFLASH[`t1`])*/ MAX(`col1`) AS `r2` FROM `t1`
WHERE `col2` IN ('1888-08-15', '1888-05-14')
GROUP BY `col2`
HAVING `col2` <= '2022-03-22';
```

### 2. What did you expect to see? (Required)

The both return the same value/ result

### 3. What did you see instead (Required)

```sql
mysql> SELECT /*+ READ_FROM_STORAGE(TIKV[`t1`])*/
-> MAX(`col1`) AS `r2`
-> FROM `t1`
-> WHERE `col2` IN ('1888-08-15', '1888-05-14')
-> GROUP BY `col2`
-> HAVING `col2` <= '2022-03-22';
ERROR 1105 (HY000): other error: [components/tidb_query_expr/src/types/expr_builder.rs:460]: Unable to decode date time from the request
mysql>
mysql> SELECT /*+ READ_FROM_STORAGE(TIFLASH[`t1`])*/
-> MAX(`col1`) AS `r2`
-> FROM `t1`
-> WHERE `col2` IN ('1888-08-15', '1888-05-14')
-> GROUP BY `col2`
-> HAVING `col2` <= '2022-03-22';
Empty set (0.02 sec)
```

### 4. What is your TiDB version? (Required)

TiDB v8.4.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.