summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb_alter_table/t/other_alter.test
blob: a28138d9afafb53242a5cbb541023748eb62899e (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
#--source include/have_tokudb.inc
SET DEFAULT_STORAGE_ENGINE='tokudb';

--disable_warnings
DROP TABLE IF EXISTS foo,bar;
--enable_warnings

set session tokudb_disable_slow_alter=ON;


create table foo (aa int, bb int, cc int, dd int, ee int, a int, b varchar(20), c int, d int, e int, primary key (e), key(d), unique key(c), key (b) clustering=yes)engine=TokuDB;
create table bar (a int) engine=TokuDB;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo drop primary key;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo drop primary key, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo drop primary key, drop column aa;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table bar add primary key (a);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table bar add primary key (a), add column z int;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo drop primary key, add primary key (b);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo drop primary key, add primary key (b), add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo drop primary key, add primary key (b), drop column aa;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_TABLE_CANT_HANDLE_FT
alter table foo add fulltext key(b);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_TABLE_CANT_HANDLE_SPKEYS
alter table foo add spatial key (aa);

# change default
alter table foo alter column cc set default 101010;
alter table foo alter column cc set default NULL;
alter table foo alter column cc drop default;

# Supporting these should be trivial
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo alter column cc set default 101010, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo alter column cc set default NULL, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo alter column cc drop default, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo alter column cc set default 101010, drop column aa;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo alter column cc set default NULL, drop column aa;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo alter column cc drop default, drop column aa;

# these one day MAY be supported
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aaa int, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column e epk int, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aaa int, drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column e epk int, drop column bb;
show create table foo;

# the following changes of a column should be slow
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa int NOT NULL;
#--error ER_UNSUPPORTED_EXTENSION
#alter table foo change column aa aa bigint;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa varchar(20);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa int after cc;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa int NOT NULL;
#--error ER_UNSUPPORTED_EXTENSION
#alter table foo modify column aa bigint;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa varchar(20);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa int after cc;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa int NOT NULL, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa bigint, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa varchar(20), add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa int after cc, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa int NOT NULL, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa bigint, add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa varchar(20), add column z int;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa int after cc, add column z int;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa int NOT NULL, drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa bigint, drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa varchar(20), drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo change column aa aa int after cc, drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa int NOT NULL, drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa bigint, drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa varchar(20), drop column bb;
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
alter table foo modify column aa int after cc, drop column bb;



drop table foo;
drop table bar;