summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb_alter_table/t/hot_row_format_alter.test
blob: 6a5b7d9a1ca5cdf9150f4ffff74f3a9ed106a01f (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
--source include/have_tokudb.inc
#
# Verify that row format changes are non-blocking, hot operations.
#
SET DEFAULT_STORAGE_ENGINE='tokudb';
set tokudb_hide_default_row_format=false;

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

set session tokudb_disable_slow_alter=ON;
CREATE TABLE foo(a int auto_increment, b int, primary key(a))engine=TokuDB;
INSERT INTO foo (b)
VALUES (11), (21), (32);

SELECT * FROM foo;

#
# Verify each compression type change is hot/non-blocking.
#
ALTER TABLE foo compression=TOKUDB_LZMA;
SHOW CREATE TABLE foo;
select * from foo;
ALTER TABLE foo compression=TOKUDB_QUICKLZ;
SHOW CREATE TABLE foo;
select * from foo;
ALTER TABLE foo compression=TOKUDB_UNCOMPRESSED;
SHOW CREATE TABLE foo;
select * from foo;
ALTER TABLE foo compression=TOKUDB_ZLIB;
SHOW CREATE TABLE foo;
select * from foo;
ALTER TABLE foo compression=TOKUDB_FAST;
SHOW CREATE TABLE foo;
select * from foo;
ALTER TABLE foo compression=TOKUDB_SMALL;
SHOW CREATE TABLE foo;
select * from foo;

#
# Trying to change row format along with another 
# option should NOT be hot/non-blocking.  
#
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE foo compression=TOKUDB_LZMA, add column c int;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE foo compression=TOKUDB_LZMA, drop column b;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE foo compression=TOKUDB_LZMA,  add key b(b);

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE foo compression=TOKUDB_LZMA,  change b b bigint;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE foo compression=TOKUDB_LZMA, change b c int;

--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE foo auto_increment=100000, compression=TOKUDB_LZMA;

DROP TABLE foo;