mariadb/mysql-test/suite/innodb/r/defrag_mdl-9155.result
Sergei Golubchik 153259874b MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to take metadatalocks
take MDL_SHARED_WRITE instead of MDL_SHARED_NO_READ_WRITE
for OPTIMIZE TABLE. For engines that need a stronger
lock (like MyISAM), reopen the table with
MDL_SHARED_NO_READ_WRITE.
2016-05-05 01:05:05 +02:00

15 lines
421 B
Text

set global innodb_defragment=1;
create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb;
insert t1 select null, repeat('a', 256) from seq_1_to_100;
select count(*) from t1;
count(*)
100
start transaction;
select count(*) from t1;
count(*)
100
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
drop table t1;
set global innodb_defragment=default;