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

Formatting issue with SQL Warning 1265 #27982

Closed
dveeden opened this issue Sep 13, 2021 · 1 comment
Closed

Formatting issue with SQL Warning 1265 #27982

dveeden opened this issue Sep 13, 2021 · 1 comment
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented Sep 13, 2021

Bug Report

1. Minimal reproduce step (Required)


5.7.25-TiDB-v5.2.1 127.0.0.1:4000  test  SQL  CREATE TABLE t1 (e enum('a','b') NOT NULL PRIMARY KEY);
Query OK, 0 rows affected (0.1761 sec)
5.7.25-TiDB-v5.2.1 127.0.0.1:4000  test  SQL  SET sql_mode='';
Query OK, 0 rows affected (0.0008 sec)
5.7.25-TiDB-v5.2.1 127.0.0.1:4000  test  SQL  INSERT INTO t1 VALUES('foo');
Query OK, 1 row affected, 1 warning (0.0569 sec)
Warning (code 1265): Data truncated for column '%s' at row %d

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

Warning (code  1265): Data truncated for column 'e' at row 1

3. What did you see instead (Required)

Warning (code 1265): Data truncated for column '%s' at row %d

4. What is your TiDB version? (Required)

5.7.25-TiDB-v5.2.1 127.0.0.1:4000  test  SQL  SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.2.1
Edition: Community
Git Commit Hash: cd8fb24c5f7ebd9d479ed228bb41848bd5e97445
Git Branch: heads/refs/tags/v5.2.1
UTC Build Time: 2021-09-08 02:32:56
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.0012 sec)

Other info

The error works fine:

5.7.25-TiDB-v5.2.1 127.0.0.1:4000  test  SQL  set sql_mode='strict_all_tables';
Query OK, 0 rows affected (0.0008 sec)
5.7.25-TiDB-v5.2.1 127.0.0.1:4000  test  SQL  INSERT INTO t1 VALUES('foo');
ERROR: 1265 (01000): Data truncated for column 'e' at row 1

#27503 might be related

@dveeden dveeden added the type/bug The issue is confirmed as a bug. label Sep 13, 2021
@dveeden dveeden changed the title Formatting issue with SQL Warnng 1265 Formatting issue with SQL Warning 1265 Sep 13, 2021
@dveeden
Copy link
Contributor Author

dveeden commented Sep 28, 2023

This is fixed in master. Probably fixed by #47267

sql> CREATE TABLE t1 (e enum('a','b') NOT NULL PRIMARY KEY);
Query OK, 0 rows affected (0.0177 sec)

sql> SET sql_mode='';
Query OK, 0 rows affected (0.0007 sec)

sql> INSERT INTO t1 VALUES('foo');
Query OK, 1 row affected, 1 warning (0.0033 sec)
Warning (code 1265): Data truncated for column 'e' at row 1

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.0009 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/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants