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: Create prompt error,Set primary key, insert duplicate value, no error reported #963

Closed
2 of 3 tasks
shangyanwen opened this issue Nov 17, 2022 · 1 comment
Closed
2 of 3 tasks
Assignees
Labels
A-bug Something isn't working

Comments

@shangyanwen
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

mysql> create table if not exists t (k integer, v integer, primary key(k))engine=tianmu;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t(k, v) values (1, 1);
Query OK, 1 row affected (0.00 sec)

####notes:This should prompt an error
mysql> insert into t(k, v) values (1, 1);
Query OK, 1 row affected (0.00 sec)

Expected behavior

MySQL(innodb) results:

mysql> insert into t(k, v) values (1, 1);
Query OK, 1 row affected (0.00 sec)

mysql> insert into t(k, v) values (1, 1);
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'

How To Reproduce

create table if not exists t (k integer, v integer, primary key(k))engine=tianmu;
insert into t(k, v) values (1, 1);
insert into t(k, v) values (1, 1);

Environment

root@ub01:/stonedb57/install/bin# ./mysql --version
./mysql  Ver 14.14 Distrib 5.7.36-StoneDB, for Linux (x86_64) using  EditLine wrapper

#notes:v1.2.2

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@adofsauron
Copy link
Collaborator

It has been repaired

mysql> create table if not exists t (k integer, v integer, primary key(k))engine=tianmu;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t(k, v) values (1, 1);
Query OK, 1 row affected (0.01 sec)

mysql> insert into t(k, v) values (1, 1);
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> select * from t;
+---+------+
| k | v    |
+---+------+
| 1 |    1 |
+---+------+
1 row in set (0.00 sec)


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

No branches or pull requests

4 participants