summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test
blob: eee661023a8f3fe6805b6d45d472c9677876eb32 (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
SET DEFAULT_STORAGE_ENGINE = 'tokudb';

--disable_warnings
DROP TABLE IF EXISTS foo;
--enable_warnings
set tokudb_disable_slow_alter=on;

create table foo (
    a timestamp, 
    b timestamp(1), 
    c timestamp(2),
    d timestamp(3),
    e timestamp(4),
    f timestamp(5),
    g timestamp(6)
) engine=TokuDB;

--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a timestamp(1);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a timestamp(2);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a timestamp(3);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a timestamp(4);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a timestamp(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a timestamp(6);

alter table foo change b b timestamp(2);
show create table foo;
alter table foo change b b timestamp(1);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b timestamp(3);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b timestamp(4);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b timestamp(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b timestamp(6);

--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d timestamp(2);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d timestamp(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d timestamp(6);

alter table foo change f f timestamp(6);
alter table foo change f f timestamp(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change f f timestamp(4);
drop table foo;


create table foo (
    a datetime, 
    b datetime(1), 
    c datetime(2),
    d datetime(3),
    e datetime(4),
    f datetime(5),
    g datetime(6)
) engine=TokuDB;

--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a datetime(1);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a datetime(2);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a datetime(3);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a datetime(4);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a datetime(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a datetime(6);

alter table foo change b b datetime(2);
show create table foo;
alter table foo change b b datetime(1);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b datetime(3);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b datetime(4);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b datetime(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b datetime(6);

--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d datetime(2);
alter table foo change d d datetime(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d datetime(6);

--error ER_UNSUPPORTED_EXTENSION
alter table foo change g g datetime(5);
drop table foo;


create table foo (
    a time, 
    b time(1), 
    c time(2),
    d time(3),
    e time(4),
    f time(5),
    g time(6)
) engine=TokuDB;

--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a time(1);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a time(2);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a time(3);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a time(4);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a time(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change a a time(6);

alter table foo change b b time(2);
show create table foo;
alter table foo change b b time(1);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b time(3);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b time(4);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b time(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change b b time(6);

--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d time(2);
alter table foo change d d time(5);
--error ER_UNSUPPORTED_EXTENSION
alter table foo change d d time(6);

--error ER_UNSUPPORTED_EXTENSION
alter table foo change g g time(5);
drop table foo;


create table foo (a int, b int) engine=TokuDB;
insert into foo values (1,2);
alter table foo add column tt timestamp(3) NOT NULL Default '1981-11-01 10:11:13.123' after a;
select * from foo;
alter table foo drop column tt;

alter table foo add column tt datetime(3) NOT NULL Default '1981-11-01 10:11:13.123' after a;
select * from foo;
alter table foo drop column tt;


alter table foo add column tt time(3) NOT NULL Default '10:11:13.123' after a;
select * from foo;
alter table foo drop column tt;

drop table foo;