summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/parts/t/partition_alter_myisam.test
blob: 794c07797f9f45422daca4a27010e95c520df79a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--source include/have_partition.inc
--let $engine=MyISAM
--source inc/part_alter_values.inc

#
# MDEV-14026 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for partitioned MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
#

replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
--disable_warnings
eval create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
  partition by key(c1) (
    partition p01 data directory = '$MYSQL_TMP_DIR'
                 index directory = '$MYSQL_TMP_DIR',
    partition p02 data directory = '$MYSQL_TMP_DIR'
                 index directory = '$MYSQL_TMP_DIR');
--enable_warnings
insert into t1 values (1, 1, repeat('a', 100));
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
alter online table t1 delay_key_write=0;
alter online table t1 delay_key_write=1;
drop table t1;

--echo #
--echo # MDEV-25102 UNIQUE USING HASH error after ALTER ... DISABLE KEYS
--echo #
create table t1 (i1 int primary key, i2 int, d1 date, key(i2))
partition by hash(i1) partitions 3;
insert into t1 values(0, 1, '2010-10-10');
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
alter table t1 disable keys;
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
alter table t1 add partition (partition p4);
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
drop table t1;

--echo # End of 10.11 tests