drop table if exists t1;
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
select * from t1;
c1	c2	stamp
replace delayed into t1 (c1, c2)  values ( "text1","11");
ERROR HY000: DELAYED option not supported for table 't1'
select * from t1;
c1	c2	stamp
replace delayed into t1 (c1, c2)  values ( "text1","12");
ERROR HY000: DELAYED option not supported for table 't1'
select * from t1;
c1	c2	stamp
drop table t1;
#
#  MDEV-35115 Inconsistent Replace behaviour when multiple
#               unique index exist
#
CREATE TABLE t1 (c1 NUMERIC UNSIGNED NOT NULL,
c2 INT3 UNIQUE,
c3 BIT(2) PRIMARY KEY)ENGINE=InnoDB;
ALTER TABLE t1 ADD UNIQUE INDEX(c1);
INSERT INTO t1 (c1,c2,c3) VALUES (0,0,b'01');
INSERT INTO t1 (c1,c2,c3) VALUES (1,1,b'10');
FLUSH STATUS;
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
VARIABLE_NAME	VARIABLE_VALUE
HANDLER_DELETE	0
HANDLER_READ_KEY	0
HANDLER_UPDATE	0
HANDLER_WRITE	0
REPLACE INTO t1 (c1,c2,c3) VALUES (0,1,b'11');
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
VARIABLE_NAME	VARIABLE_VALUE
HANDLER_DELETE	1
HANDLER_READ_KEY	2
HANDLER_UPDATE	1
HANDLER_WRITE	2
SELECT * FROM t1;
c1	c2	c3
0	1	
DROP TABLE t1;
CREATE TABLE t1 (f1 INT NOT NULL PRIMARY KEY,
f2 INT, f3 INT, f4 INT,
UNIQUE INDEX i1(f2))ENGINE=InnoDB;
ALTER TABLE t1 ADD INDEX i3(f4);
ALTER TABLE t1 ADD UNIQUE INDEX i2(f3);
INSERT INTO t1 VALUES (0,0,0,0);
INSERT INTO t1 VALUES (1,1,1,1);
FLUSH STATUS;
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
VARIABLE_NAME	VARIABLE_VALUE
HANDLER_DELETE	0
HANDLER_READ_KEY	0
HANDLER_UPDATE	0
HANDLER_WRITE	0
REPLACE INTO t1 VALUES (0,0,1,1);
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
VARIABLE_NAME	VARIABLE_VALUE
HANDLER_DELETE	1
HANDLER_READ_KEY	2
HANDLER_UPDATE	1
HANDLER_WRITE	2
DROP TABLE t1;
