pingcap / pingcap/tiflash

Missing double overflow error exception in Tiflash

Open
#9,654 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects-8.4 affects-8.5 component/compute impact/inconsistency severity/moderate type/bug
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)
Drop table if exists t1;
CREATE TABLE t1 (
    id INT PRIMARY KEY AUTO_INCREMENT
);

ALTER TABLE t1 SET TIFLASH REPLICA 1;
INSERT INTO t1 values (1000);

SELECT /*+ READ_FROM_STORAGE(TIKV[t1])*/
    EXP(id) AS exp_overflow
FROM
    t1;

SELECT /*+ READ_FROM_STORAGE(TIFLASH[t1])*/
    EXP(id) AS exp_overflow
FROM
    t1;
2. What did you expect to see? (Required)

I find that the returned information is inconsistent across two queries.

3. What did you see instead (Required)
mysql> SELECT /*+ READ_FROM_STORAGE(TIFLASH[t1])*/     EXP(id) AS exp_overflow FROM     t1;
+--------------+
| exp_overflow |
+--------------+
|            0 |
+--------------+
1 row in set (0.04 sec)

mysql> SELECT /*+ READ_FROM_STORAGE(TIKV[t1])*/     EXP(id) AS exp_overflow FROM     t1;
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(cast(test1.t1.id, double BINARY))'
4. What is your TiDB version? (Required)

TiDB v8.4.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided SQL reproduction on TiKV and TiFlash, then compare how each path handles EXP(id) for the value 1000. Done means the TiFlash query reports the same double-overflow error as the TiKV query instead of returning 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.