Skip to content

Error message of duplicate primary key is not shown properly #35289

@tangenta

Description

@tangenta

Enhancement

Actual:

mysql> CREATE TABLE t1 (a BINARY(16) PRIMARY KEY);
Query OK, 0 rows affected (0.02 sec)

mysql> INSERT INTO t1 VALUES (AES_ENCRYPT('a','a'));
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t1 VALUES (AES_ENCRYPT('a','a'));
ERROR 1062 (23000): Duplicate entry '{ W]�u����.�٧t' for key 'PRIMARY'

Expected:

mysql> CREATE TABLE t1 (a BINARY(16) PRIMARY KEY);
Query OK, 0 rows affected (0.05 sec)

mysql> INSERT INTO t1 VALUES (AES_ENCRYPT('a','a'));
Query OK, 1 row affected (0.02 sec)

mysql> INSERT INTO t1 VALUES (AES_ENCRYPT('a','a'));
ERROR 1062 (23000): Duplicate entry '{ W]\xA1\x06u\x9D\xBD\xB1\xA3.\xE2\xD9\xA7t' for key 't1.PRIMARY'

Metadata

Metadata

Assignees

Labels

type/enhancementThe issue or PR belongs to an enhancement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions