SET DEFAULT_STORAGE_ENGINE = 'tokudb'; DROP TABLE IF EXISTS foo; create table foo (a varchar (100), primary key (a)); insert into foo values ("a"),("B"),("c"),("D"),("e"),("F"),("A"); ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' insert into foo values ("a"),("B"),("c"),("D"),("e"),("F"); insert into foo values ("C"); ERROR 23000: Duplicate entry 'C' for key 'PRIMARY' insert into foo values ("d"); ERROR 23000: Duplicate entry 'd' for key 'PRIMARY' begin; update foo set a="C" where a="c"; select * from foo; a a B C D e F rollback; select * from foo; a a B c D e F select * from foo where a="c"; a c select * from foo where a="C"; a c select * from foo where a > "c"; a D e F select * from foo where a > "C"; a D e F select * from foo where a >= "c"; a c D e F select * from foo where a >= "C"; a c D e F select * from foo where a < "c"; a a B select * from foo where a < "C"; a a B select * from foo where a <= "c"; a a B c select * from foo where a <= "C"; a a B c update foo set a = "d" where a="a"; ERROR 23000: Duplicate entry 'd' for key 'PRIMARY' update foo set a = "C" where a="a"; ERROR 23000: Duplicate entry 'C' for key 'PRIMARY' drop table foo; create table foo (a varchar (100), b int, primary key (a), key(b)); insert into foo values ("a",1000),("B",1),("c",10000),("D",10),("e",109),("F",1),("A",1); ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' insert into foo values ("a",3),("B",1),("c",4),("D",2),("e",11),("F",8); insert into foo values ("C",1); ERROR 23000: Duplicate entry 'C' for key 'PRIMARY' insert into foo values ("d",1); ERROR 23000: Duplicate entry 'd' for key 'PRIMARY' begin; update foo set a="C" where a="c"; select * from foo; a b B 1 D 2 a 3 C 4 F 8 e 11 rollback; select * from foo; a b B 1 D 2 a 3 c 4 F 8 e 11 update foo set a = "d" where a="a"; ERROR 23000: Duplicate entry 'd' for key 'PRIMARY' update foo set a = "C" where a="a"; ERROR 23000: Duplicate entry 'C' for key 'PRIMARY' drop table foo; create table foo (a varchar (100), b int, unique key (a), primary key(b)); insert into foo values ("a",1000),("B",1),("c",10000),("D",10),("e",109),("F",1),("A",22); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' insert into foo values ("a",3),("B",1),("c",4),("D",2),("e",11),("F",8); insert into foo values ("C",100); ERROR 23000: Duplicate entry 'C' for key 'a' insert into foo values ("d",100); ERROR 23000: Duplicate entry 'd' for key 'a' begin; update foo set a="C" where a="c"; select * from foo; a b a 3 B 1 C 4 D 2 e 11 F 8 rollback; select * from foo; a b a 3 B 1 c 4 D 2 e 11 F 8 update foo set a = "d" where a="a"; ERROR 23000: Duplicate entry 'd' for key 'a' update foo set a = "C" where a="a"; ERROR 23000: Duplicate entry 'C' for key 'a' select * from foo where a="c"; a b c 4 select * from foo where a="C"; a b c 4 select * from foo where a > "c"; a b D 2 e 11 F 8 select * from foo where a > "C"; a b D 2 e 11 F 8 select * from foo where a >= "c"; a b c 4 D 2 e 11 F 8 select * from foo where a >= "C"; a b c 4 D 2 e 11 F 8 select * from foo where a < "c"; a b a 3 B 1 select * from foo where a < "C"; a b a 3 B 1 select * from foo where a <= "c"; a b a 3 B 1 c 4 select * from foo where a <= "C"; a b a 3 B 1 c 4 drop table foo;