Skip to content

1062 warning returns invalid UTF8 message #31639

@est

Description

@est

1. Minimal reproduce step (Required)

select version();
5.7.25-TiDB-v5.1.0
create table t1 (id binary(20) unique);
INSERT IGNORE INTO t1  VALUES (X'0e6b4234fd0b08d4c4ec656529d94df02b37c472');
INSERT IGNORE INTO t1  VALUES (X'0e6b4234fd0b08d4c4ec656529d94df02b37c472');
show warnings;

Protocol returning Warning 1062 with following message:

  • On MySQL (8.0.15-6):
    "Duplicate entry '\\x0EkB4\\xFD\\x0B\\x08\\xD4\\xC4\\xECee)\\xD9M\\xF0+7\\xC4r' for key 'idx_id'"

  • On TiDB (5.7.25-TiDB-v5.1.0):
    "Duplicate entry '\x0ekB4\x0b\x08ee)M+7r' for key 'idx_id'"

The above output were Python (mycli+PyMySQL) string objects I grabbed through debugging, other clients would see gibberish.

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

The TiDB should return properly escaped, valid UTF-8 string message

3. What did you see instead (Required)

The TiDB returns a message containing invalid UTF-8 bytes which cause client library decoding errors

4. What is your TiDB version? (Required)

5.7.25-TiDB-v5.1.0

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions