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

The "data truncated" warning message is not properly formatted #25076

Closed
tangenta opened this issue Jun 3, 2021 · 2 comments
Closed

The "data truncated" warning message is not properly formatted #25076

tangenta opened this issue Jun 3, 2021 · 2 comments
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@tangenta
Copy link
Contributor

tangenta commented Jun 3, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists tbl_15;
create table tbl_15 (col_90 enum('Alice','Bob','Charlie','David'));
insert ignore into tbl_15 values ('oAtXDXThAboyRjgW');
show warnings;

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

MySQL:

+---------+------+---------------------------------------------+
| Level   | Code | Message                                     |
+---------+------+---------------------------------------------+
| Warning | 1265 | Data truncated for column 'col_90' at row 1 |
+---------+------+---------------------------------------------+

3. What did you see instead (Required)

+---------+------+------------------------------------------+
| Level   | Code | Message                                  |
+---------+------+------------------------------------------+
| Warning | 1265 | Data truncated for column '%s' at row %d |
+---------+------+------------------------------------------+

4. What is your TiDB version? (Required)

master

commit b7e448aa109c4ebf819ad0ca9fd6d3864d401ad5
Author: Howie <haoweili35@gmail.com>
Date:   Wed Jun 2 15:56:26 2021 +0800

    ddl: add auto random && shard_row_id_bits compatibility for temporary table (#24940)
@tangenta tangenta added the type/bug The issue is confirmed as a bug. label Jun 3, 2021
@Defined2014
Copy link
Contributor

I think the root cause is same as #27959 (comment)

@dveeden
Copy link
Contributor

dveeden commented Sep 28, 2023

Looks like this was fixed by #47267

sql> drop table if exists tbl_15;
Query OK, 0 rows affected, 1 warning (0.0015 sec)
Note (code 1051): Unknown table 'test.tbl_15'

sql> create table tbl_15 (col_90 enum('Alice','Bob','Charlie','David'));
Query OK, 0 rows affected (0.0162 sec)

sql> insert ignore into tbl_15 values ('oAtXDXThAboyRjgW');
Query OK, 1 row affected, 1 warning (0.0007 sec)
Warning (code 1265): Data truncated for column 'col_90' at row 1

sql> show warnings;
+---------+------+---------------------------------------------+
| Level   | Code | Message                                     |
+---------+------+---------------------------------------------+
| Warning | 1265 | Data truncated for column 'col_90' at row 1 |
+---------+------+---------------------------------------------+
1 row in set (0.0008 sec)

sql> SELECT TIDB_VERSION()\G
*************************** 1. row ***************************
TIDB_VERSION(): Release Version: v7.5.0-alpha-6-g2992c1cc98
Edition: Community
Git Commit Hash: 2992c1cc98bfee3b62a27b9913a308e1cfa96667
Git Branch: master
UTC Build Time: 2023-09-28 09:13:58
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore
1 row in set (0.0010 sec)

@dveeden dveeden closed this as completed Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants