-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: Failed to insert a null value to the composite primary key. #1374
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DROP DATABASE IF EXISTS composite_primary_key_test; | ||
CREATE DATABASE composite_primary_key_test; | ||
USE composite_primary_key_test; | ||
create table ttt(id int,c1 varchar(10),c2 varchar(10),primary key(id,c1)) ENGINE=TIANMU; | ||
insert into ttt values(1,'xxx','xxx'); | ||
insert into ttt values(1,'','xxx'); | ||
insert into ttt values(1,'','xxx'); | ||
ERROR 23000: Duplicate entry '1-' for key 'PRIMARY' | ||
DROP DATABASE composite_primary_key_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--source include/have_tianmu.inc | ||
|
||
--disable_warnings | ||
DROP DATABASE IF EXISTS composite_primary_key_test; | ||
--enable_warnings | ||
|
||
CREATE DATABASE composite_primary_key_test; | ||
|
||
USE composite_primary_key_test; | ||
|
||
--disable_warnings | ||
|
||
## DDL | ||
create table ttt(id int,c1 varchar(10),c2 varchar(10),primary key(id,c1)) ENGINE=TIANMU; | ||
|
||
## insert data | ||
insert into ttt values(1,'xxx','xxx'); | ||
|
||
insert into ttt values(1,'','xxx'); | ||
--error ER_DUP_ENTRY | ||
insert into ttt values(1,'','xxx'); | ||
|
||
|
||
## clean test table | ||
DROP DATABASE composite_primary_key_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters