*** Bug #28158 ***
SET @@storage_engine = 'Falcon';
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
CREATE TABLE t1 (a int, b int, KEY (a, b));
CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b));
CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b));
INSERT INTO t1 VALUES (1, 2);
INSERT INTO t1 VALUES (2, 2);
INSERT INTO t2 VALUES (1, 2);
INSERT INTO t2 VALUES (2, 2);
INSERT INTO t3 VALUES (1, 2);
INSERT INTO t3 VALUES (2, 2);
UPDATE t1 SET a = 1;
UPDATE t1 SET a = 1 ORDER BY a;
UPDATE t2 SET a = 1;
ERROR 23000: Duplicate entry '1-2' for key 'a'
UPDATE t2 SET a = 1 ORDER BY a;
ERROR 23000: Duplicate entry '1-2' for key 'a'
UPDATE t3 SET a = 1;
ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
UPDATE t3 SET a = 1 ORDER BY a;
ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
SELECT count(*) FROM t1;
count(*)
2
SELECT count(*) FROM t2;
count(*)
2
SELECT count(*) FROM t3;
count(*)
2
SELECT * FROM t1 ORDER by a;
a	b
1	2
1	2
SELECT * FROM t2 ORDER by a;
a	b
1	2
2	2
SELECT * FROM t3 ORDER by a;
a	b
1	2
2	2
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
CREATE TABLE t1 (a int, b int, KEY (a, b));
CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b));
INSERT INTO t1 VALUES (1, 2);
INSERT INTO t1 VALUES (2, 2);
INSERT INTO t2 VALUES (1, 2);
INSERT INTO t2 VALUES (2, 2);
UPDATE t1, t2 SET t1.a = 1, t2.a = 1;
ERROR 23000: Duplicate entry '1-2' for key 'a'
SELECT count(*) FROM t1;
count(*)
2
SELECT count(*) FROM t2;
count(*)
2
SELECT * FROM t1 ORDER by a;
a	b
1	2
2	2
SELECT * FROM t2 ORDER by a;
a	b
1	2
2	2
DROP TABLE t1;
DROP TABLE t2;
