Decimal overflow misbehavior in BinaryArithmeticFunctions.
Open
Nobody has claimed this yet.
component/compute
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)
use test;
CREATE TABLE t
(pk INTEGER PRIMARY KEY,
dc1 DECIMAL(12, 4),
dc2 DECIMAL(30, 30),
dc3 DECIMAL(65, 0),
dc4 DECIMAL(65, 30));
INSERT INTO t VALUES
(0, -99999999.9999, -.999999999999999999999999999999,
-99999999999999999999999999999999999999999999999999999999999999999,
-99999999999999999999999999999999999.999999999999999999999999999999),
(1, 0, 0, 0, 0),
(2, 99999999.9999, .999999999999999999999999999999,
99999999999999999999999999999999999999999999999999999999999999999,
99999999999999999999999999999999999.999999999999999999999999999999);
ALTER TABLE t SET TIFLASH REPLICA 1;
set @@session.tidb_isolation_read_engines="tiflash";
set tidb_enforce_mpp=1;
select dc1 + dc3 from t;
select dc1 - dc3 from t;
2. What did you expect to see? (Required)


3. What did you see instead (Required)

4. What is your TiFlash version? (Required)
tiflash-v5.3.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided CREATE TABLE, INSERT, TiFlash replica, and dc1 +/- dc3 queries against TiFlash v5.3.0, then compare the results with the expected and observed screenshots. Done means decimal addition and subtraction no longer misbehave or overflow for the reproduced DECIMAL combinations.
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
- 30/100