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

[Bug]: confusing error message when load insert into a table with a unique index #1971

Open
lyukun opened this issue May 17, 2024 · 0 comments
Assignees
Labels
type: bug Something isn't working

Comments

@lyukun
Copy link

lyukun commented May 17, 2024

Describe the bug

全量旁路导入,无主键表 设置unique 索引,插入索引列数据重复的数据,报primary key冲突,
Environment

observer (OceanBase 4.3.2.0)
REVISION: 1-23719066af791450c309f6c596abe45716c958a5
BUILD_BRANCH: master
BUILD_TIME: May 9 2024 15:05:09
BUILD_FLAGS: RelWithDebInfo|Sanity
BUILD_INFO: jenkins-oceanbase_build_master_7u_santiy-B4836

Fast Reproduce Steps(Required)

Steps to reproduce the behavior:
无主键表 设置unique 索引,插入索引列数据重复的数据,报primary key冲突,提示信息不精准
image

Expected behavior

MySQL的报错更准确
MySQL [test]> CREATE TABLE users (
-> id INT AUTO_INCREMENT PRIMARY KEY,
-> email VARCHAR(255) NOT NULL,
-> UNIQUE INDEX (email)
-> );
Query OK, 0 rows affected (0.05 sec)

MySQL [test]> insert into users(email) values ('liugs.lgs');
Query OK, 1 row affected (0.04 sec)

MySQL [test]> insert into users(email) values ('liugs.lgs');
ERROR 1062 (23000): Duplicate entry 'liugs.lgs' for key 'users.email'
Actual Behavior

报 ERROR 1062(23000): Duplicated primary key
image

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant