126
126
alter table t1 disable keys;
127
127
show keys from t1;
128
128
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
129
t1 0 n1 1 n1 A 0 NULL NULL BTREE
130
t1 1 n1_2 1 n1 A NULL NULL NULL BTREE
131
t1 1 n1_2 2 n2 A NULL NULL NULL YES BTREE
132
t1 1 n1_2 3 n3 A NULL NULL NULL YES BTREE
133
t1 1 n1_2 4 n4 A NULL NULL NULL YES BTREE
134
t1 1 n2 1 n2 A NULL NULL NULL YES BTREE
135
t1 1 n2 2 n3 A NULL NULL NULL YES BTREE
136
t1 1 n2 3 n4 A NULL NULL NULL YES BTREE
137
t1 1 n2 4 n1 A NULL NULL NULL BTREE
138
t1 1 n3 1 n3 A NULL NULL NULL YES BTREE
139
t1 1 n3 2 n4 A NULL NULL NULL YES BTREE
140
t1 1 n3 3 n1 A NULL NULL NULL BTREE
141
t1 1 n3 4 n2 A NULL NULL NULL YES BTREE
142
t1 1 n4 1 n4 A NULL NULL NULL YES BTREE
143
t1 1 n4 2 n1 A NULL NULL NULL BTREE
144
t1 1 n4 3 n2 A NULL NULL NULL YES BTREE
145
t1 1 n4 4 n3 A NULL NULL NULL YES BTREE
129
t1 0 n1 1 n1 NULL 0 NULL NULL BTREE
130
t1 1 n1_2 1 n1 NULL NULL NULL NULL BTREE
131
t1 1 n1_2 2 n2 NULL NULL NULL NULL YES BTREE
132
t1 1 n1_2 3 n3 NULL NULL NULL NULL YES BTREE
133
t1 1 n1_2 4 n4 NULL NULL NULL NULL YES BTREE
134
t1 1 n2 1 n2 NULL NULL NULL NULL YES BTREE
135
t1 1 n2 2 n3 NULL NULL NULL NULL YES BTREE
136
t1 1 n2 3 n4 NULL NULL NULL NULL YES BTREE
137
t1 1 n2 4 n1 NULL NULL NULL NULL BTREE
138
t1 1 n3 1 n3 NULL NULL NULL NULL YES BTREE
139
t1 1 n3 2 n4 NULL NULL NULL NULL YES BTREE
140
t1 1 n3 3 n1 NULL NULL NULL NULL BTREE
141
t1 1 n3 4 n2 NULL NULL NULL NULL YES BTREE
142
t1 1 n4 1 n4 NULL NULL NULL NULL YES BTREE
143
t1 1 n4 2 n1 NULL NULL NULL NULL BTREE
144
t1 1 n4 3 n2 NULL NULL NULL NULL YES BTREE
145
t1 1 n4 4 n3 NULL NULL NULL NULL YES BTREE
146
146
insert into t1 values(10,RAND()*1000,RAND()*1000,RAND());
147
147
insert into t1 values(9,RAND()*1000,RAND()*1000,RAND());
148
148
insert into t1 values(8,RAND()*1000,RAND()*1000,RAND());
156
156
alter table t1 enable keys;
157
157
show keys from t1;
158
158
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
159
t1 0 n1 1 n1 A 10 NULL NULL BTREE
160
t1 1 n1_2 1 n1 A NULL NULL NULL BTREE
161
t1 1 n1_2 2 n2 A NULL NULL NULL YES BTREE
162
t1 1 n1_2 3 n3 A NULL NULL NULL YES BTREE
163
t1 1 n1_2 4 n4 A NULL NULL NULL YES BTREE
164
t1 1 n2 1 n2 A NULL NULL NULL YES BTREE
165
t1 1 n2 2 n3 A NULL NULL NULL YES BTREE
166
t1 1 n2 3 n4 A NULL NULL NULL YES BTREE
167
t1 1 n2 4 n1 A NULL NULL NULL BTREE
168
t1 1 n3 1 n3 A NULL NULL NULL YES BTREE
169
t1 1 n3 2 n4 A NULL NULL NULL YES BTREE
170
t1 1 n3 3 n1 A NULL NULL NULL BTREE
171
t1 1 n3 4 n2 A NULL NULL NULL YES BTREE
172
t1 1 n4 1 n4 A NULL NULL NULL YES BTREE
173
t1 1 n4 2 n1 A NULL NULL NULL BTREE
174
t1 1 n4 3 n2 A NULL NULL NULL YES BTREE
175
t1 1 n4 4 n3 A NULL NULL NULL YES BTREE
159
t1 0 n1 1 n1 NULL 10 NULL NULL BTREE
160
t1 1 n1_2 1 n1 NULL NULL NULL NULL BTREE
161
t1 1 n1_2 2 n2 NULL NULL NULL NULL YES BTREE
162
t1 1 n1_2 3 n3 NULL NULL NULL NULL YES BTREE
163
t1 1 n1_2 4 n4 NULL NULL NULL NULL YES BTREE
164
t1 1 n2 1 n2 NULL NULL NULL NULL YES BTREE
165
t1 1 n2 2 n3 NULL NULL NULL NULL YES BTREE
166
t1 1 n2 3 n4 NULL NULL NULL NULL YES BTREE
167
t1 1 n2 4 n1 NULL NULL NULL NULL BTREE
168
t1 1 n3 1 n3 NULL NULL NULL NULL YES BTREE
169
t1 1 n3 2 n4 NULL NULL NULL NULL YES BTREE
170
t1 1 n3 3 n1 NULL NULL NULL NULL BTREE
171
t1 1 n3 4 n2 NULL NULL NULL NULL YES BTREE
172
t1 1 n4 1 n4 NULL NULL NULL NULL YES BTREE
173
t1 1 n4 2 n1 NULL NULL NULL NULL BTREE
174
t1 1 n4 3 n2 NULL NULL NULL NULL YES BTREE
175
t1 1 n4 4 n3 NULL NULL NULL NULL YES BTREE
177
177
create table t1 (i int unsigned not null auto_increment primary key);
178
178
alter table t1 rename t2;
554
554
alter table t1 enable keys;
555
555
show indexes from t1;
556
556
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
557
t1 1 a 1 a A NULL NULL NULL YES BTREE
557
t1 1 a 1 a NULL NULL NULL NULL YES BTREE
558
558
alter table t1 modify a bigint, disable keys;
559
559
show indexes from t1;
560
560
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
562
562
alter table t1 enable keys;
563
563
show indexes from t1;
564
564
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
565
t1 1 a 1 a A NULL NULL NULL YES BTREE
565
t1 1 a 1 a NULL NULL NULL NULL YES BTREE
566
566
alter table t1 add b char(10), disable keys;
567
567
show indexes from t1;
568
568
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
575
575
alter table t1 disable keys;
576
576
show indexes from t1;
577
577
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
578
t1 1 a 1 a A NULL NULL NULL YES BTREE
578
t1 1 a 1 a NULL NULL NULL NULL YES BTREE
580
580
Field Type Null Key Default Extra
581
581
a bigint(20) YES MUL NULL
595
595
alter table t1 disable keys;
596
596
show indexes from t1;
597
597
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
598
t1 0 a 1 a A 0 NULL NULL YES BTREE
598
t1 0 a 1 a NULL 0 NULL NULL YES BTREE
599
599
alter table t1 enable keys;
600
600
"If no copy on noop change, this won't touch the data file"
601
601
"Unique index, no change"
627
627
alter table t1 disable keys;
628
628
show indexes from t1;
629
629
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
630
t1 0 a 1 a A 0 NULL NULL YES BTREE
631
t1 1 b 1 b A NULL NULL NULL YES BTREE
630
t1 0 a 1 a NULL 0 NULL NULL YES BTREE
631
t1 1 b 1 b NULL NULL NULL NULL YES BTREE
632
632
alter table t1 enable keys;
633
633
"If no copy on noop change, this won't touch the data file"
634
634
"The non-unique index will be disabled"
640
640
alter table t1 enable keys;
641
641
show indexes from t1;
642
642
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
643
t1 0 a 1 a A 0 NULL NULL YES BTREE
644
t1 1 b 1 b A NULL NULL NULL YES BTREE
643
t1 0 a 1 a NULL 0 NULL NULL YES BTREE
644
t1 1 b 1 b NULL NULL NULL NULL YES BTREE
645
645
"Change the type implying data copy"
646
646
"The non-unique index will be disabled"
647
647
alter table t1 modify a bigint, disable keys;
663
663
t1 1 b 1 b A NULL NULL NULL YES BTREE
665
665
create database mysqltest;
666
create table t1 (c1 int);
666
create table t1 (c1 int) engine=myisam;
667
667
alter table t1 rename mysqltest.t1;
669
669
ERROR 42S02: Unknown table 't1'