Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different error code from MySQL when inserting incorrect bigint value #17832

Open
zhangysh1995 opened this issue Jun 7, 2020 · 16 comments
Open
Assignees
Labels
challenge-program good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@zhangysh1995
Copy link

zhangysh1995 commented Jun 7, 2020

Description

Bug Report

1. Minimal reproduce step (Required)

drop table if exists t0;create table t0 (col0 VARCHAR(0), col1 TINYINT, col2 TEXT, col3 BLOB, col4 BIGINT);insert into t0 values (NULL, '-128', 't', 'b', '2 ^ 63 - 1');

2. What did you expect to see? (Required)

From both errors it is clear I shouldn't use 2^63 in the value. But I'm confused with the meaning of the error.

-- MySQL 5.7
mysql> drop table if exists t0;create table t0 (col0 VARCHAR(0), col1 TINYINT, col2 TEXT, col3 BLOB, col4 BIGINT);insert into t0 values (NULL, '-128', 't', 'b', '2 ^ 63 - 1');
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.03 sec)

ERROR 1265 (01000): Data truncated for column 'col4' at row 1

-- MySQL 8
mysql> drop table if exists t0;create table t0 (col0 VARCHAR(0), col1 TINYINT, col2 TEXT, col3 BLOB, col4 BIGINT);insert into t0 values (NULL, '-128', 't', 'b', '2 ^ 63 - 1');
Query OK, 0 rows affected (0.03 sec)

Query OK, 0 rows affected (0.08 sec)

ERROR 1265 (01000): Data truncated for column 'col4' at row 1

3. What did you see instead (Required)

mysql> drop table if exists t0;create table t0 (col0 VARCHAR(0), col1 TINYINT, col2 TEXT, col3 BLOB, col4 BIGINT);insert into t0 values (NULL, '-128', 't', 'b', '2 ^ 63 - 1');
Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.01 sec)

ERROR 1366 (HY000): Incorrect bigint value: '2 ^ 63 - 1' for column 'col4' at row 1

4. Affected version (Required)

commit 8369ffd500f3fb235d8b584ac4298b2e59d8db55 (HEAD -> master, origin/master, origin/HEAD)
Author: Soup <ilovesoup@gmail.com>
Date:   Tue May 26 15:38:29 2020 +0800

5. Root Cause Analysis

SIG slack channel

#sig-exec

Score

  • 300

Mentor

@zhangysh1995 zhangysh1995 added the type/bug The issue is confirmed as a bug. label Jun 7, 2020
@djshow832 djshow832 added the sig/execution SIG execution label Jun 8, 2020
@qw4990 qw4990 self-assigned this Jun 8, 2020
@qw4990
Copy link
Contributor

qw4990 commented Jun 8, 2020

@zhangysh1995 Thanks for your feedback, we will fix this issue soon.

@qw4990 qw4990 added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Jun 8, 2020
@TszKitLo40
Copy link
Contributor

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@ti-challenge-bot
Copy link

@TszKitLo40 You did not submit PR within 7 days, so give up automatically.

@ti-challenge-bot ti-challenge-bot bot removed the picked label Sep 14, 2020
@TszKitLo40
Copy link
Contributor

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@ti-challenge-bot
Copy link

@TszKitLo40 You did not submit PR within 7 days, so give up automatically.

@ti-challenge-bot ti-challenge-bot bot removed the picked label Sep 21, 2020
@TszKitLo40
Copy link
Contributor

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@ti-challenge-bot
Copy link

@TszKitLo40 You did not submit PR within 7 days, so give up automatically.

@ti-challenge-bot ti-challenge-bot bot removed the picked label Sep 28, 2020
@TszKitLo40
Copy link
Contributor

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@ti-challenge-bot
Copy link

@TszKitLo40 You did not submit PR within 7 days, so give up automatically.

@ti-challenge-bot ti-challenge-bot bot removed the picked label Oct 6, 2020
@TszKitLo40
Copy link
Contributor

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@ti-challenge-bot
Copy link

@TszKitLo40 You did not submit PR within 7 days, so give up automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
6 participants