[MDEV-14026] ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for partitioned MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options Created: 2017-10-07  Updated: 2020-08-25  Resolved: 2017-12-25

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Partitioning, Storage Engine - MyISAM
Affects Version/s: 10.2.9
Fix Version/s: 10.2.12, 10.1.31

Type: Bug Priority: Major
Reporter: Valerii Kravchuk Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-13636 ALTER TABLE ... DELAY_KEY_WRITE=1 cre... Closed
relates to MDEV-15266 partition_alter_myisam fails with -DW... Open
Sprint: 10.2.12

 Description   

It seems MDEV-13636 was NOT fixed for the case of partitioned MyISAM table that uses DATA DIRECTORY/INDEX DIRECTORY to store partitions. Check the following:

MariaDB [test]> create table tmi_part_dd ( c1 int, c2 int, c3 varchar(100)) engine=MyISAM delay_key_write=1 partition by key(c1) (partition p01 data directory = '/tmp' index directory = '/tmp' engine = MyISAM, partition p02 data directory = '/tmp' index directory = '/tmp' engine=MyISAM);
Query OK, 0 rows affected (0.07 sec)
 
MariaDB [test]> insert into tmi_part_dd values (1, 1, repeat('a', 100));
Query OK, 1 row affected (0.03 sec)
 
MariaDB [test]> insert into tmi_part_dd select rand()*1000, rand()*1000, repeat('b', 100) from tmi_part_dd;
Query OK, 1 row affected (0.01 sec)
Records: 1  Duplicates: 0  Warnings: 0
 
MariaDB [test]> insert into tmi_part_dd select rand()*1000, rand()*1000, repeat('b', 100) from tmi_part_dd;
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0
 
MariaDB [test]> insert into tmi_part_dd select rand()*1000, rand()*1000, repeat('b', 100) from tmi_part_dd;
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0
 
...
 
MariaDB [test]> alter table tmi_part_dd delay_key_write=0;
Stage: 2 of 2 'enabling keys'      0% of stage done
 
Query OK, 2097152 rows affected (3.24 sec)
Records: 2097152  Duplicates: 0  Warnings: 0
 
MariaDB [test]> alter table tmi_part_dd delay_key_write=1;
Query OK, 2097152 rows affected (1.94 sec)
Records: 2097152  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select version();
+----------------+
| version()      |
+----------------+
| 10.2.9-MariaDB |
+----------------+
1 row in set (0.00 sec)
 
MariaDB [test]> \! ls /tmp/*.M*
/tmp/tmi_part_dd#P#p01.MYD  /tmp/tmi_part_dd#P#p02.MYD
/tmp/tmi_part_dd#P#p01.MYI  /tmp/tmi_part_dd#P#p02.MYI


Generated at Thu Feb 08 08:10:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.