I’m in the progress of migrating a large amount of tables from InnoDB to TokuDB and have found what looks like a bug.
Scenario is that I have a table with partition in InnoDB and want to use pt-online-schema-change to change the partitioning layout and migrate to TokuDB.
CREATE TABLE temp.`test_1` ( `id` int(1) DEFAULT NULL ) DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) (PARTITION p1 VALUES LESS THAN (2) , PARTITION p2 VALUES LESS THAN (4) ) */
set global default_storage_engine=TokuDB;
I then use --default-engine option to the new table will be created with TokuDB
pt-online-schema-change --dry-run --progress percentage,1 --no-drop-new-table --default-engine --alter "reorganize partition p1,p2 into (\ PARTITION p3 VALUES LESS THAN (6), \ PARTITION p4 VALUES LESS THAN (9), \ PARTITION pMAX VALUES LESS THAN MAXVALUE);" D=temp,t=test_1,h=localhost
PTdebug shows the table that is created looks like this:
# pt_online_schema_change:9618 622 CREATE TABLE `temp`.`_test_1_new` ( # `id` int(1) DEFAULT NULL # ) DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT # /*!50100 PARTITION BY RANGE (id) # (PARTITION p1 VALUES LESS THAN (2) ENGINE = InnoDB, # PARTITION p2 VALUES LESS THAN (4) ENGINE = InnoDB) */
And I get the error “The mix of handlers in the partitions is not allowed in this version of MySQL”. This because the table is created with the default engine (TokuDB) but the partitions are created with InnoDB as it was on the original table.
So it looks like that --default-engine doesn’t handle the ENGINE on each partition.