summaryrefslogtreecommitdiff
path: root/mysql-test/r/alter_table_online.result
blob: e3f285437a7911e6ef9d9d67592b1a2d15d04e45 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
alter online table t1 change b new_name int;
alter online table t1 modify e enum('a','b','c');
alter online table t1 comment "new comment";
alter online table t1 algorithm=INPLACE, lock=NONE;
alter online table t1;
alter table t1 algorithm=INPLACE;
alter table t1 lock=NONE;
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
alter online table t1 change b new_name int;
alter online table t1 modify e enum('a','b','c');
alter online table t1 comment "new comment";
alter online table t1 rename to t2;
drop table t2;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 modify b bigint;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 modify e enum('c','a','b');
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 modify c varchar(50);
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 modify c varchar(100);
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 add f int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 engine=memory;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
alter online table t1 rename to t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
alter online table t1 drop index b;
alter online table t1 comment "new comment";
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
alter online table t1 modify b bigint;
alter online table t1 modify e enum('c','a','b');
alter online table t1 modify c varchar(50);
alter online table t1 modify c varchar(100);
alter online table t1 add f int;
alter online table t1 engine=memory;
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
alter online table t1 drop index b;
drop table t1;
create table t1 (a int not null primary key, b int, c varchar(80));
create table t2 (a int not null primary key, b int, c varchar(80));
create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge UNION=(t1);
alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3;
create table t1 (i int) partition by hash(i) partitions 2;
alter online table t1 comment 'test';
drop table t1;
create table t1 (a int);
alter online table t1 modify a int comment 'test';
drop table t1;
create table t1 (a int) engine=innodb;
alter online table t1 modify a int comment 'test';
drop table t1;
create table t1 (a int) partition by hash(a) partitions 2;
alter online table t1 modify a int comment 'test';
drop table t1;
#
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#
CREATE TABLE t1 (a BINARY(10));
ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a VARBINARY(10));
ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a TINYBLOB);
ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMBLOB);
ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a LONGBLOB);
ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10));
ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10));
ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT);
ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT);
ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a TEXT);
ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT);
ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10));
ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10));
ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT);
ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT);
ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TEXT);
ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
#
# End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#