Wrong function result in Tikv
- 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
DROP table IF EXISTS t0;
DROP table IF EXISTS t1;
DROP view IF EXISTS v0;
CREATE TABLE t0(c0 NUMERIC UNSIGNED ZEROFILL UNIQUE, PRIMARY KEY(c0));
CREATE TABLE t1 LIKE t0;
INSERT INTO t0(c0) VALUES (2025) ON DUPLICATE KEY UPDATE c0=((t0.c0)OR(NULL));
INSERT IGNORE INTO t0(c0) VALUES (-2024);
CREATE VIEW v0(c0) AS SELECT NULL FROM t0;
INSERT INTO t1(c0) VALUES (2023) ON DUPLICATE KEY UPDATE c0=t1.c0;
ALTER TABLE t0 SET TIFLASH REPLICA 1;
ALTER TABLE t1 SET TIFLASH REPLICA 1;
SELECT /*+ read_from_storage(tikv[t0, t1]) */ COUNT(t0.c0) FROM t0, v0, t1 WHERE t0.c0 <> t1.c0 and ATAN(t0.c0, (- ('A1')));
SELECT /*+ read_from_storage(tiflash[t0, t1]) */ COUNT(t0.c0) FROM t0, v0, t1 WHERE t0.c0 <> t1.c0 and ATAN(t0.c0, (- ('A1')));
```
### 2. What did you expect to see? (Required)
I find that tikv show different behavior with tiflash
### 3. What did you see instead (Required)
```sql
mysql> SELECT /*+ read_from_storage(tiflash[t0, t1]) */ COUNT(t0.c0) FROM t0, v0, t1 WHERE t0.c0 <> t1.c0 and ATAN(t0.c0, (- ('A1')));
+--------------+
| COUNT(t0.c0) |
+--------------+
| 4 |
+--------------+
1 row in set, 1 warning (0.06 sec)
mysql> SELECT /*+ read_from_storage(tikv[t0, t1]) */ COUNT(t0.c0) FROM t0, v0, t1 WHERE t0.c0 <> t1.c0 and ATAN(t0.c0, (- ('A1')));
+--------------+
| COUNT(t0.c0) |
+--------------+
| 2 |
+--------------+
1 row in set, 1 warning (0.04 sec)
```
### 4. What is your TiDB version? (Required)
TiDB v8.5.0
Contributor guide
Assessment
This issue has not been assessed yet.