Skip to content

mismatch the warning message and error code with MySQL 5.7 #13136

Closed
@siddontang

Description

@siddontang

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

Create a table and insert some values, the table schema:

mysql> show create table item1 \G;
*************************** 1. row ***************************
       Table: item1
Create Table: CREATE TABLE `item1` (
  `i_id` int(11) NOT NULL,
  `i_im_id` int(11) DEFAULT NULL,
  `i_name` varchar(24) DEFAULT NULL,
  `i_price` decimal(5,2) DEFAULT NULL,
  `i_data` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`i_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

then select

mysql> select count(*) from item1 where i_data ;
+----------+
| count(*) |
+----------+
|    14769 |
+----------+
1 row in set, 65535 warnings (0.05 sec)
  1. What did you expect to see?

Like MySQL 5.7, the warning message should be:

mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                 |
+---------+------+-----------------------------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: 'i9pT0zpXTxFYTxMtHP6h3VVZL5y7Pr2zC6ttY5C5QXMg6t8KY'  |
| Warning | 1292 | Truncated incorrect INTEGER value: 'uOa4vwxAYTZjkRv5K4kyWsSFuctocROdPAW47hw2vnnp'       |
| Warning | 1292 | Truncated incorrect INTEGER value: 'tQabPDFTPjGr5hAkFnAQMlIIPR7C4pBnTAGrmm0a0T8'        |
| Warning | 1292 | Truncated incorrect INTEGER value: 'j3B7JLBhCe5xNmj1KSxL2avY0j6xyyUuemQeR5xCxdgM'       |
| Warning | 1292 | Truncated incorrect INTEGER value: 'O5lYdP5HWrloobWqyiYdp6XvqAZPxuodqFmTB'              |
  1. What did you see instead?

But got:

| Warning | 1105 | Data Truncated                                                                                  |
| Warning | 1105 | Data Truncated                                                                                  |
| Warning | 1105 | Data Truncated                                                                                  |
| Warning | 1105 | Data Truncated                                                                                  |
| Warning | 1105 | Data Truncated                                                                                  |
| Warning | 1105 | Data Truncated                                                                                  |
| Warning | 1105 | Data Truncated                                                                                  |
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions