|
| 1 | +set autocommit= 0; |
| 2 | +create table test.t1(id int, name varchar(100)) engine=innodb; |
| 3 | +create index t1_ind_1 on test.t1(id); |
| 4 | +insert into test.t1 values(1, 'test'); |
| 5 | +create table test.t2(id int, name varchar(100)) engine=myisam; |
| 6 | +create index t2_ind_1 on test.t2(id); |
| 7 | +insert into test.t2 values(1, 'test'); |
| 8 | +commit; |
| 9 | +select * from test.t1; |
| 10 | +id name |
| 11 | +1 test |
| 12 | +select * from test.t2; |
| 13 | +id name |
| 14 | +1 test |
| 15 | +alter table test.t1 no_wait add extra varchar(10); |
| 16 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 17 | +alter table test.t1 no_wait rename to test.r1; |
| 18 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 19 | +alter table test.t1 no_wait add primary key(id); |
| 20 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 21 | +alter table test.t2 no_wait add extra varchar(10); |
| 22 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 23 | +alter table test.t2 no_wait rename to test.r2; |
| 24 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 25 | +alter table test.t2 no_wait add primary key(id); |
| 26 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 27 | +drop table test.t1 no_wait; |
| 28 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 29 | +truncate table test.t1 no_wait; |
| 30 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 31 | +optimize table test.t1 no_wait; |
| 32 | +Table Op Msg_type Msg_text |
| 33 | +test.t1 optimize Error Lock wait timeout exceeded; try restarting transaction |
| 34 | +test.t1 optimize status Operation failed |
| 35 | +rename table test.t1 no_wait to test.r1; |
| 36 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 37 | +drop table test.t2 no_wait; |
| 38 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 39 | +truncate table test.t2 no_wait; |
| 40 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 41 | +optimize table test.t2 no_wait; |
| 42 | +Table Op Msg_type Msg_text |
| 43 | +test.t2 optimize Error Lock wait timeout exceeded; try restarting transaction |
| 44 | +test.t2 optimize status Operation failed |
| 45 | +rename table test.t2 no_wait to test.r2; |
| 46 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 47 | +drop index t1_ind_1 on test.t1 no_wait; |
| 48 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 49 | +create index t1_ind_2 on test.t1(id) no_wait; |
| 50 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 51 | +drop index t2_ind_1 on test.t2 no_wait; |
| 52 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 53 | +create index t2_ind_2 on test.t2(id) no_wait; |
| 54 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 55 | +create fulltext index t2_ind_3 on test.t2(name) no_wait; |
| 56 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 57 | +alter table test.t1 wait 1 add extra varchar(10); |
| 58 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 59 | +alter table test.t1 wait 1 rename to test.r1; |
| 60 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 61 | +alter table test.t1 wait 1 add primary key(id); |
| 62 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 63 | +alter table test.t2 wait 1 add extra varchar(10); |
| 64 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 65 | +alter table test.t2 wait 1 rename to test.r2; |
| 66 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 67 | +alter table test.t2 wait 1 add primary key(id); |
| 68 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 69 | +drop table test.t1 wait 1; |
| 70 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 71 | +truncate table test.t1 wait 1; |
| 72 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 73 | +optimize table test.t1 wait 1; |
| 74 | +Table Op Msg_type Msg_text |
| 75 | +test.t1 optimize Error Lock wait timeout exceeded; try restarting transaction |
| 76 | +test.t1 optimize status Operation failed |
| 77 | +rename table test.t1 wait 1 to test.r1; |
| 78 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 79 | +drop table test.t2 wait 1; |
| 80 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 81 | +truncate table test.t2 wait 1; |
| 82 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 83 | +optimize table test.t2 wait 1; |
| 84 | +Table Op Msg_type Msg_text |
| 85 | +test.t2 optimize Error Lock wait timeout exceeded; try restarting transaction |
| 86 | +test.t2 optimize status Operation failed |
| 87 | +rename table test.t2 wait 1 to test.r2; |
| 88 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 89 | +drop index t1_ind_1 on test.t1 wait 1; |
| 90 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 91 | +create index t1_ind_2 on test.t1(id) wait 1; |
| 92 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 93 | +drop index t2_ind_1 on test.t2 wait 1; |
| 94 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 95 | +create index t2_ind_2 on test.t2(id) wait 1; |
| 96 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 97 | +create fulltext index t2_ind_3 on test.t2(name) wait 1; |
| 98 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 99 | +commit; |
| 100 | +alter table test.t1 no_wait add extra varchar(10); |
| 101 | +alter table test.t1 no_wait rename to test.r1; |
| 102 | +alter table test.r1 no_wait rename to test.t1; |
| 103 | +alter table test.t1 no_wait add primary key(id); |
| 104 | +alter table test.t2 no_wait add extra varchar(10); |
| 105 | +alter table test.t2 no_wait rename to test.r2; |
| 106 | +alter table test.r2 no_wait rename to test.t2; |
| 107 | +alter table test.t2 no_wait add primary key(id); |
| 108 | +truncate table test.t1 no_wait; |
| 109 | +optimize table test.t1 no_wait; |
| 110 | +Table Op Msg_type Msg_text |
| 111 | +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 112 | +test.t1 optimize status OK |
| 113 | +rename table test.t1 no_wait to test.r1; |
| 114 | +rename table test.r1 no_wait to test.t1; |
| 115 | +truncate table test.t2 no_wait; |
| 116 | +optimize table test.t2 no_wait; |
| 117 | +Table Op Msg_type Msg_text |
| 118 | +test.t2 optimize status Table is already up to date |
| 119 | +rename table test.t2 no_wait to test.r2; |
| 120 | +rename table test.r2 no_wait to test.t2; |
| 121 | +drop index t1_ind_1 on test.t1 no_wait; |
| 122 | +create index t1_ind_2 on test.t1(id) no_wait; |
| 123 | +drop index t2_ind_1 on test.t2 no_wait; |
| 124 | +create index t2_ind_2 on test.t2(id) no_wait; |
| 125 | +create fulltext index t2_ind_3 on test.t2(name) no_wait; |
| 126 | +drop table test.t1 no_wait; |
| 127 | +drop table test.t2 no_wait; |
| 128 | +create table test.t1 (id int, name varchar(100)) engine=innodb; |
| 129 | +create index t1_ind_1 on test.t1(id); |
| 130 | +insert into test.t1 values (1, 'test'); |
| 131 | +create table test.t2 (id int, name varchar(100)) engine=myisam; |
| 132 | +create index t2_ind_1 on test.t2(id); |
| 133 | +insert into test.t2 values(1, 'test'); |
| 134 | +commit; |
| 135 | +alter table test.t1 wait 1 add extra varchar(10); |
| 136 | +alter table test.t1 wait 1 rename to test.r1; |
| 137 | +alter table test.r1 wait 1 rename to test.t1; |
| 138 | +alter table test.t1 wait 1 add primary key(id); |
| 139 | +alter table test.t2 wait 1 add extra varchar(10); |
| 140 | +alter table test.t2 wait 1 rename to test.r2; |
| 141 | +alter table test.r2 wait 1 rename to test.t2; |
| 142 | +alter table test.t2 wait 1 add primary key(id); |
| 143 | +truncate table test.t1 wait 1; |
| 144 | +optimize table test.t1 wait 1; |
| 145 | +Table Op Msg_type Msg_text |
| 146 | +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 147 | +test.t1 optimize status OK |
| 148 | +rename table test.t1 wait 1 to test.r1; |
| 149 | +rename table test.r1 wait 1 to test.t1; |
| 150 | +truncate table test.t2 wait 1; |
| 151 | +optimize table test.t2 wait 1; |
| 152 | +Table Op Msg_type Msg_text |
| 153 | +test.t2 optimize status Table is already up to date |
| 154 | +rename table test.t2 wait 1 to test.r2; |
| 155 | +rename table test.r2 wait 1 to test.t2; |
| 156 | +drop index t1_ind_1 on test.t1 wait 1; |
| 157 | +create index t1_ind_2 on test.t1(id) wait 1; |
| 158 | +drop index t2_ind_1 on test.t2 wait 1; |
| 159 | +create index t2_ind_2 on test.t2(id) wait 1; |
| 160 | +create fulltext index t2_ind_3 on test.t2(name) wait 1; |
| 161 | +drop table test.t1 wait 1; |
| 162 | +drop table test.t2 wait 1; |
| 163 | +create table test.t1 (a int); |
| 164 | +begin; |
| 165 | +insert into test.t1 values (1); |
| 166 | +alter table test.t1 wait 2 add index (a); |
| 167 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 168 | +alter table test.t1 no_wait add index (a); |
| 169 | +ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 170 | +commit; |
| 171 | +drop table test.t1; |
0 commit comments