CREATE TABLE worklog5743 (
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
PRIMARY KEY (col_1_text(3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
SELECT col_1_text = REPEAT("a", 3500) , col_2_text  = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text  = REPEAT("o", 3500)
1	1
connect  con1,localhost,root,,;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text = REPEAT("o", 3500)
1	1
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
connect  con2,localhost,root,,;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
connection con1;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text = REPEAT("o", 3500)
1	1
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
START TRANSACTION;
connection default;
SET GLOBAL innodb_fast_shutdown=3;
# restart
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
SELECT col_1_text = REPEAT("a", 3500) , col_2_text  = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text  = REPEAT("o", 3500)
1	1
disconnect con1;
disconnect con2;
connect  con1,localhost,root,,;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text = REPEAT("o", 3500)
1	1
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text = REPEAT("o", 3500)
1	1
connection default;
SET GLOBAL innodb_fast_shutdown=3;
# restart
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
SELECT col_1_text = REPEAT("a", 3500) , col_2_text  = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text  = REPEAT("o", 3500)
1	1
disconnect con1;
connect  con2,localhost,root,,;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text = REPEAT("o", 3500)
1	1
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
START TRANSACTION;
UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500);
SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("b", 3500)	col_2_text = REPEAT("o", 3500)
1	1
connection default;
SET GLOBAL innodb_fast_shutdown=3;
# restart
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
SELECT col_1_text = REPEAT("a", 3500) , col_2_text  = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500)	col_2_text  = REPEAT("o", 3500)
1	1
DROP TABLE worklog5743;
#
# MDEV-21245 InnoDB: Using a partial-field key prefix in search
#
CREATE TABLE t1 (a VARCHAR(255), KEY k(a)) DEFAULT CHARSET=utf8mb3
ENGINE=InnoDB;
INSERT INTO t1 set a='';
alter table t1 change a a varchar(3000);
affected rows: 0
info: Records: 0  Duplicates: 0  Warnings: 1
Warnings:
Note	1071	Specified key was too long; max key length is 3072 bytes
SELECT * FROM t1 WHERE a IN ('');
a

DROP TABLE t1;
# End of 10.4 tests
