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
|
set default_storage_engine=tokudb;
drop table if exists test_enum;
CREATE TABLE test_enum (col1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT, col2 ENUM('value1','value2','value3') NULL);
INSERT INTO test_enum (col2) VALUES ('value1'),('value1'),('value3');
SELECT * FROM test_enum;
col1 col2
1 value1
2 value1
3 value3
set tokudb_disable_hot_alter=0;
set tokudb_disable_slow_alter=1;
ALTER TABLE test_enum MODIFY COLUMN col2 ENUM('value1','value2','value3');
SELECT * FROM test_enum;
col1 col2
1 value1
2 value1
3 value3
drop table test_enum;
CREATE TABLE test_enum (col1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT, col2 ENUM('value1','value2','value3') NULL);
INSERT INTO test_enum (col2) VALUES ('value1'),('value1'),('value3');
SELECT * FROM test_enum;
col1 col2
1 value1
2 value1
3 value3
set tokudb_disable_hot_alter=0;
set tokudb_disable_slow_alter=1;
ALTER TABLE test_enum MODIFY COLUMN col2 ENUM('value1','value3');
ERROR 42000: Table 'test_enum' uses an extension that doesn't exist in this XYZ version
set tokudb_disable_hot_alter=1;
set tokudb_disable_slow_alter=0;
ALTER TABLE test_enum MODIFY COLUMN col2 ENUM('value1','value3');
SELECT * FROM test_enum;
col1 col2
1 value1
2 value1
3 value3
drop table test_enum;
CREATE TABLE test_enum (col1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT, col2 ENUM('value1','value2','value3') NULL);
INSERT INTO test_enum (col2) VALUES ('value1'),('value1'),('value3');
SELECT * FROM test_enum;
col1 col2
1 value1
2 value1
3 value3
set tokudb_disable_hot_alter=0;
set tokudb_disable_slow_alter=1;
ALTER TABLE test_enum MODIFY COLUMN col2 ENUM('value1','value2','value4');
ERROR 42000: Table 'test_enum' uses an extension that doesn't exist in this XYZ version
set tokudb_disable_hot_alter=1;
set tokudb_disable_slow_alter=0;
ALTER TABLE test_enum MODIFY COLUMN col2 ENUM('value1','value2','value4');
Warnings:
Warning 1265 Data truncated for column 'col2' at row 3
SELECT * FROM test_enum;
col1 col2
1 value1
2 value1
3
drop table test_enum;
|