mysql> CREATE TABLE `t1` ( -> `a` int(10) unsigned NOT NULL AUTO_INCREMENT,
-> `b` varchar(255) DEFAULT NULL,
-> PRIMARY KEY (`a`)
-> ) ENGINE=TokuDB DEFAULT CHARSET=latin1
-> /*!50100 PARTITION BY RANGE (a)
-> (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB,
-> PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */;
Query OK, 0 rows affected (0.23 sec)
mysql> alter table t1 add clustering index cl_b (`b`);
ERROR 1478 (HY000): Table storage engine 'partition' does not support the create option 'CLUSTERING'
Bugs is here:
(gdb) bt
#0 mysql_prepare_create_table (thd=0x183e1290, create_info=0x7ffda427d430, alter_info=0x7ffda427d370, tmp_table=true, db_options=0x7ffda427ac70, file=0x7ffd54006358, key_info_buffer=0x7ffda427bbf8, key_\
count=0x7ffda427bbcc, select_field_count=0) at /home/rfp/ps5620/percona-server-5.6/sql/sql_table.cc:3785
#1 0x000000000083b71f in create_table_impl (thd=0x183e1290, db=0x7ffd540052a0 "test", table_name=0x7ffda427c840 "#sql-6ce3_2", path=0x7ffda427d0ac "./test/#sql-6ce3_2", create_info=0x7ffda427d430, alter\
_info=0x7ffda427d370, internal_tmp_table=true, select_field_count=0, no_ha_table=true, is_trans=0x0, key_info=0x7ffda427bbf8, key_count=0x7ffda427bbcc) at /home/rfp/ps5620/percona-server-5.6/sql/sql_tabl\
e.cc:4737
#2 0x00000000008444ea in mysql_alter_table (thd=0x183e1290, new_db=0x7ffd540052a0 "test", new_name=0x0, create_info=0x7ffda427d430, table_list=0x7ffd54004d40, alter_info=0x7ffda427d370, order_num=0, ord\
er=0x0, ignore=false) at /home/rfp/ps5620/percona-server-5.6/sql/sql_table.cc:8426
#3 0x0000000000989799 in Sql_cmd_alter_table::execute (this=0x7ffd54005368, thd=0x183e1290) at /home/rfp/ps5620/percona-server-5.6/sql/sql_alter.cc:317
#4 0x00000000007d18d1 in mysql_execute_command (thd=0x183e1290) at /home/rfp/ps5620/percona-server-5.6/sql/sql_parse.cc:5384
#5 0x00000000007d4b4d in mysql_parse (thd=0x183e1290, rawbuf=0x7ffd54004c30 "alter table t1 add clustering index cl_b (`b`)", length=46, parser_state=0x7ffda427f1d0) at /home/rfp/ps5620/percona-server-5\
.6/sql/sql_parse.cc:6746
#6 0x00000000007c72e8 in dispatch_command (command=COM_QUERY, thd=0x183e1290, packet=0x183e53e1 "alter table t1 add clustering index cl_b (`b`)", packet_length=46) at /home/rfp/ps5620/percona-server-5.6\
/sql/sql_parse.cc:1434
Partition storage engine needs to pass up the clustering flag from the underlying engine.
percona server 5.6 + tokudb 7.1.8
https://github.com/percona/percona-server/commit/c35c30a5d456f0011f9807430253bc9d05d0ee68 disabled the test until this is closed
Worked with Bohu Tang on a patch to Percona Server to allow secondary clustering indexes for tokudb tables. A partial patch is on this branch: https://github.com/prohaska7/percona-server/tree/db720. The idea is to allow clustering indexes for partitioned tables and then error out in the various storage engines like innodb that do not yet support this feature.
5.6 merged in https://github.com/percona/percona-server/pull/269
5.7 merged in https://github.com/percona/percona-server/pull/270