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

Error 1292: Truncated incorrect BINARY value #25245

Closed
jingshanglu opened this issue Jun 8, 2021 · 2 comments
Closed

Error 1292: Truncated incorrect BINARY value #25245

jingshanglu opened this issue Jun 8, 2021 · 2 comments
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 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

@jingshanglu
Copy link
Contributor

jingshanglu commented Jun 8, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Create Table: CREATE TABLE `PK_S_MULTI_29` (
  `COL1` bit(45) NOT NULL,
  `COL2` bit(45) NOT NULL,
  `COL3` bit(45) DEFAULT NULL,
  PRIMARY KEY (`COL1`,`COL2`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

insert into PK_S_MULTI_29 select * from PK_S_MULTI_29 where col1 = 0x3335313834333732303838383331 on duplicate key update col1 = 0x3335313834333732303;

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

mysql 8.0

insert successful

3. What did you see instead (Required)

ERROR 1292 (22007): Truncated incorrect BINARY value: '0x3335313834333732303838383331'

4. What is your TiDB version? (Required)

tidb_version(): Release Version: v5.1.0-alpha-14-gd1b3e4711-dirty
Edition: Community
Git Commit Hash: d1b3e47111a34a2d3e9ca9aec94292f822c2f5a4
Git Branch: master
UTC Build Time: 2021-05-25 02:44:30
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@jingshanglu jingshanglu added type/bug The issue is confirmed as a bug. severity/moderate sig/sql-infra SIG: SQL Infra severity/major and removed severity/moderate labels Jun 8, 2021
@djshow832 djshow832 added sig/execution SIG execution help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed sig/sql-infra SIG: SQL Infra labels Aug 2, 2021
@wzru
Copy link
Contributor

wzru commented Aug 12, 2021

Could you please provide some more complete SQL? I cannot repeat now

tidb> CREATE TABLE `PK_S_MULTI_29` (   `COL1` bit(45) NOT NULL,   `COL2` bit(45) NOT NULL,   `COL3` bit(45) DEFAULT NULL,   PRIMARY KEY (`COL1`,`COL2`) /*T![clustered_index] NONCLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
Query OK, 0 rows affected (0.00 sec)
tidb> insert into PK_S_MULTI_29_tmp select * from PK_S_MULTI_29_tmp where col1 = 0x3335313834333732303838383331 on duplicate key update col1 = 0x3335313834333732303;
ERROR 1146 (42S02): Table 'test.PK_S_MULTI_29_tmp' doesn't exist

@jebter jebter added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. labels Jan 11, 2022
@zanmato1984
Copy link
Contributor

I tried to reproduce in my local MySQL/TiDB. This case doesn't seem to make sense:

MySQL 8.0:

mysql> insert into PK_S_MULTI_29 select * from PK_S_MULTI_29 where col1 = 0x3335313834333732303838383331 on duplicate key update col1 = 0x3335313834333732303;
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0

TiDB master:

mysql> insert into PK_S_MULTI_29 select * from PK_S_MULTI_29 where col1 = 0x3335313834333732303838383331 on duplicate key update col1 = 0x3335313834333732303;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0
  1. The insert won't take effect as the table is empty and the select clause returns empty set so there is nothing to insert (unless you missed supplying the statements that create some inital-filled in data).
  2. On TiDB master, the result is the same as MySQL.

I'm closing it for now. Feel free to reopen if you find something new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 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
Development

No branches or pull requests

6 participants