pingcap / pingcap/tiflash

return BIGINT UNSIGNED value is out of range while it's not

Open
#3,170 1 comment 0 reactions 0 assignees View on GitHub

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

CREATE TABLE `UK_HP16873` (
  `COL1` bigint(16) unsigned DEFAULT NULL,
  `COL2` varchar(20) DEFAULT NULL,
  `COL4` datetime DEFAULT NULL,
  `COL3` bigint(20) DEFAULT NULL,
  `COL5` float DEFAULT NULL,
  UNIQUE KEY `UM_COL` (`COL1`,`COL3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY HASH( `COL1`+`COL3` )
PARTITIONS 8;

Insert into UK_HP16873 values (18351476220656678303, "栛艰癤睼櫻辴泠恢鸒琱刼囐碎髟ƃ圝弤橢搎旰", "5498-03-23 22:57:38", -5756849422422234130, -2.84445e+38); 

-- should be returen the correct result, but report an error
MySQL root@172.16.6.31:test> select * from UK_HP16873 where col1 + 10 > 18351476220656678303 + 10 or col1 + 10 <=> 18351476220656678303 + 10 order by col1, col2; 
(1690, "BIGINT UNSIGNED value is out of range in '(test.uk_hp16873.col1 + 10)'")


MySQL root@172.16.6.31:test> select * from information_schema.cluster_info;
+---------+-------------------+-------------------+---------+------------------------------------------+---------------------------+---------------------+-----------+
| TYPE    | INSTANCE          | STATUS_ADDRESS    | VERSION | GIT_HASH                                 | START_TIME                | UPTIME              | SERVER_ID |
+---------+-------------------+-------------------+---------+------------------------------------------+---------------------------+---------------------+-----------+
| tidb    | 172.16.6.31:4010  | 172.16.6.31:11080 | 5.2.1   | cd8fb24c5f7ebd9d479ed228bb41848bd5e97445 | 2021-09-27T15:39:55+08:00 | 18h27m6.986291206s  | 0         |
| pd      | 172.16.6.31:2379  | 172.16.6.31:2379  | 5.2.1   | 8afd38d919ec727712a9518cc3ebdcab47b2fbcb | 2021-09-27T15:28:03+08:00 | 18h38m58.986295434s | 0         |
| tikv    | 172.16.6.31:20163 | 172.16.6.31:20183 | 5.2.1   | 2c99f317d4ba125b772a8b94a6c3c0eb9d07ac59 | 2021-09-27T15:31:19+08:00 | 18h35m42.986296866s | 0         |
| tikv    | 172.16.6.31:20162 | 172.16.6.31:20182 | 5.2.1   | 2c99f317d4ba125b772a8b94a6c3c0eb9d07ac59 | 2021-09-27T15:39:38+08:00 | 18h27m23.986298197s | 0         |
| tikv    | 172.16.6.31:20161 | 172.16.6.31:20181 | 5.2.1   | 2c99f317d4ba125b772a8b94a6c3c0eb9d07ac59 | 2021-09-27T15:35:20+08:00 | 18h31m41.986299615s | 0         |
| tiflash | 172.16.6.31:3931  | 172.16.6.31:20293 | 5.2.1   | 576ddf874d84568b9ac94e803973861b00bd2b2b | 2021-09-27T15:28:03+08:00 | 18h38m58.98630096s  | 0         |
| tiflash | 172.16.6.31:3930  | 172.16.6.31:20292 | 5.2.1   | 576ddf874d84568b9ac94e803973861b00bd2b2b | 2021-09-27T15:27:31+08:00 | 18h39m30.986302747s | 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 reproducing the provided CREATE TABLE, INSERT, and SELECT statements on the reported TiFlash 5.2.1 setup, then inspect how the partition expression and BIGINT UNSIGNED arithmetic are evaluated. Done means the query returns the correct result without the erroneous 1690 out-of-range error.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.