Loading mysql-test/r/ndb_index_unique.result +6 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by a; a b c 3 4 6 insert into t1 values(8, 2, 3); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '8' for key 'PRIMARY' select * from t1 order by a; a b c 1 2 3 Loading Loading @@ -93,7 +93,7 @@ a b c 1 1 1 4 4 NULL insert into t1 values(5,1,1); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '5' for key 'PRIMARY' drop table t1; CREATE TABLE t2 ( a int unsigned NOT NULL PRIMARY KEY, Loading @@ -116,7 +116,7 @@ select * from t2 where b = 4 order by a; a b c 3 4 6 insert into t2 values(8, 2, 3); ERROR 23000: Can't write, because of unique constraint, to table 't2' ERROR 23000: Duplicate entry '8' for key 'PRIMARY' select * from t2 order by a; a b c 1 2 3 Loading Loading @@ -181,7 +181,7 @@ pk a 3 NULL 4 4 insert into t1 values (5,0); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '5' for key 'PRIMARY' select * from t1 order by pk; pk a -1 NULL Loading Loading @@ -214,7 +214,7 @@ pk a b c 0 NULL 18 NULL 1 3 19 abc insert into t2 values(2,3,19,'abc'); ERROR 23000: Can't write, because of unique constraint, to table 't2' ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select * from t2 order by pk; pk a b c -1 1 17 NULL Loading Loading @@ -634,7 +634,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select a, sha1(b) from t1; a sha1(b) 1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d Loading mysql-test/t/ndb_index_unique.test +6 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by b; insert into t1 values(7,8,3); select * from t1 where b = 4 order by a; -- error 1169 -- error 1062 insert into t1 values(8, 2, 3); select * from t1 order by a; delete from t1 where a = 1; Loading Loading @@ -59,7 +59,7 @@ select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; select * from t1 use index (bc) where b IS NULL and c = 2 order by a; select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b IS NOT NULL order by a; -- error 1169 -- error 1062 insert into t1 values(5,1,1); drop table t1; Loading @@ -82,7 +82,7 @@ select * from t2 where c = 6; insert into t2 values(7,8,3); select * from t2 where b = 4 order by a; -- error 1169 -- error 1062 insert into t2 values(8, 2, 3); select * from t2 order by a; delete from t2 where a = 1; Loading Loading @@ -133,7 +133,7 @@ insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); select * from t1 order by pk; --error 1169 --error 1062 insert into t1 values (5,0); select * from t1 order by pk; delete from t1 where a = 0; Loading @@ -152,7 +152,7 @@ insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); select * from t2 order by pk; --error 1169 --error 1062 insert into t2 values(2,3,19,'abc'); select * from t2 order by pk; delete from t2 where c IS NOT NULL; Loading Loading @@ -321,7 +321,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); --error 1169 --error 1062 insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); select a, sha1(b) from t1; Loading storage/ndb/src/ndbapi/ndberror.c +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ ErrorBundle ErrorCodes[] = { { 630, HA_ERR_FOUND_DUPP_KEY, CV, "Tuple already existed when attempting to insert" }, { 839, DMEC, CV, "Illegal null attribute" }, { 840, DMEC, CV, "Trying to set a NOT NULL attribute to NULL" }, { 893, HA_ERR_FOUND_DUPP_UNIQUE, CV, "Constraint violation e.g. duplicate value in unique index" }, { 893, HA_ERR_FOUND_DUPP_KEY, CV, "Constraint violation e.g. duplicate value in unique index" }, /** * Node recovery errors Loading Loading
mysql-test/r/ndb_index_unique.result +6 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by a; a b c 3 4 6 insert into t1 values(8, 2, 3); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '8' for key 'PRIMARY' select * from t1 order by a; a b c 1 2 3 Loading Loading @@ -93,7 +93,7 @@ a b c 1 1 1 4 4 NULL insert into t1 values(5,1,1); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '5' for key 'PRIMARY' drop table t1; CREATE TABLE t2 ( a int unsigned NOT NULL PRIMARY KEY, Loading @@ -116,7 +116,7 @@ select * from t2 where b = 4 order by a; a b c 3 4 6 insert into t2 values(8, 2, 3); ERROR 23000: Can't write, because of unique constraint, to table 't2' ERROR 23000: Duplicate entry '8' for key 'PRIMARY' select * from t2 order by a; a b c 1 2 3 Loading Loading @@ -181,7 +181,7 @@ pk a 3 NULL 4 4 insert into t1 values (5,0); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '5' for key 'PRIMARY' select * from t1 order by pk; pk a -1 NULL Loading Loading @@ -214,7 +214,7 @@ pk a b c 0 NULL 18 NULL 1 3 19 abc insert into t2 values(2,3,19,'abc'); ERROR 23000: Can't write, because of unique constraint, to table 't2' ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select * from t2 order by pk; pk a b c -1 1 17 NULL Loading Loading @@ -634,7 +634,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); ERROR 23000: Can't write, because of unique constraint, to table 't1' ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select a, sha1(b) from t1; a sha1(b) 1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d Loading
mysql-test/t/ndb_index_unique.test +6 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by b; insert into t1 values(7,8,3); select * from t1 where b = 4 order by a; -- error 1169 -- error 1062 insert into t1 values(8, 2, 3); select * from t1 order by a; delete from t1 where a = 1; Loading Loading @@ -59,7 +59,7 @@ select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; select * from t1 use index (bc) where b IS NULL and c = 2 order by a; select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b IS NOT NULL order by a; -- error 1169 -- error 1062 insert into t1 values(5,1,1); drop table t1; Loading @@ -82,7 +82,7 @@ select * from t2 where c = 6; insert into t2 values(7,8,3); select * from t2 where b = 4 order by a; -- error 1169 -- error 1062 insert into t2 values(8, 2, 3); select * from t2 order by a; delete from t2 where a = 1; Loading Loading @@ -133,7 +133,7 @@ insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); select * from t1 order by pk; --error 1169 --error 1062 insert into t1 values (5,0); select * from t1 order by pk; delete from t1 where a = 0; Loading @@ -152,7 +152,7 @@ insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); select * from t2 order by pk; --error 1169 --error 1062 insert into t2 values(2,3,19,'abc'); select * from t2 order by pk; delete from t2 where c IS NOT NULL; Loading Loading @@ -321,7 +321,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); --error 1169 --error 1062 insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); select a, sha1(b) from t1; Loading
storage/ndb/src/ndbapi/ndberror.c +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ ErrorBundle ErrorCodes[] = { { 630, HA_ERR_FOUND_DUPP_KEY, CV, "Tuple already existed when attempting to insert" }, { 839, DMEC, CV, "Illegal null attribute" }, { 840, DMEC, CV, "Trying to set a NOT NULL attribute to NULL" }, { 893, HA_ERR_FOUND_DUPP_UNIQUE, CV, "Constraint violation e.g. duplicate value in unique index" }, { 893, HA_ERR_FOUND_DUPP_KEY, CV, "Constraint violation e.g. duplicate value in unique index" }, /** * Node recovery errors Loading