pingcap / pingcap/tidb

Inconsistent Function EXP in TiDB and TiKV

Open
#60,841 2 comments 0 reactions 0 assignees View on GitHub
fuzz/sqlancer impact/inconsistency sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

### 1. Minimal reproduce step (Required)

```sql
create table t0 (c0 double);
insert into t0 values (5.84);
select EXP(LN(c0)) <= c0 from t0 where EXP(LN(c0)) <= c0; -- {0}
```

### 2. What did you expect to see? (Required)
`EXP(LN(c0))` is evaluated to `5.84` in TiKV, but `5.840000000000001` in TiDB, resulting in an unexpected result.
`EXP(LN(c0)) <= c0` is evaluated as true in `where`, which is executed in TiKV, but `EXP(LN(c0)) <= c0` is evaluated as false in `select`.

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

`0`

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

```bash
+--------------------------------------------+
| version() |
+--------------------------------------------+
| 8.0.11-TiDB-v9.0.0-beta.1.pre-563-gea52376 |
+--------------------------------------------+
```

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.