1SET DEFAULT_STORAGE_ENGINE='tokudb';
2*** Bug #22169 ***
3DROP TABLE IF EXISTS t1;
4CREATE TABLE t1 (a int, b bigint, c varchar(30), d date, e int, primary key (a));
5INSERT into t1 values (1,54,"zardosht", '1986-08-30', 3287);
6INSERT into t1 values (2,8709,"Alaadin", '1789-01-31', 8327);
7INSERT into t1 values (3,234,"Gilbert", '1325-05-21', 871233);
8INSERT into t1 values (4,563,"Lois", '1981-11-06', 654);
9INSERT into t1 values (5,587,"Lexington", '1844-03-01', 75);
10INSERT into t1 values (6,934764,"Goliath", '1161-11-01', 453);
11INSERT into t1 values (7,109234,"Peter", '2005-11-01', 5);
12INSERT into t1 values (8,9438,"Bart", '1472-11-01', 234);
13INSERT into t1 values (9,111111111,"Superman", '1776-07-04', 65);
14INSERT into t1 values (10,50000004,"Batman", '1981-11-01', 87423);
15SELECT * from t1;
16a	b	c	d	e
171	54	zardosht	1986-08-30	3287
182	8709	Alaadin	1789-01-31	8327
193	234	Gilbert	1325-05-21	871233
204	563	Lois	1981-11-06	654
215	587	Lexington	1844-03-01	75
226	934764	Goliath	1161-11-01	453
237	109234	Peter	2005-11-01	5
248	9438	Bart	1472-11-01	234
259	111111111	Superman	1776-07-04	65
2610	50000004	Batman	1981-11-01	87423
27alter table t1 drop primary key;
28SELECT * from t1;
29a	b	c	d	e
301	54	zardosht	1986-08-30	3287
312	8709	Alaadin	1789-01-31	8327
323	234	Gilbert	1325-05-21	871233
334	563	Lois	1981-11-06	654
345	587	Lexington	1844-03-01	75
356	934764	Goliath	1161-11-01	453
367	109234	Peter	2005-11-01	5
378	9438	Bart	1472-11-01	234
389	111111111	Superman	1776-07-04	65
3910	50000004	Batman	1981-11-01	87423
40alter table t1 add primary key (a,d,c(3),e,b);
41SELECT * from t1;
42a	b	c	d	e
431	54	zardosht	1986-08-30	3287
442	8709	Alaadin	1789-01-31	8327
453	234	Gilbert	1325-05-21	871233
464	563	Lois	1981-11-06	654
475	587	Lexington	1844-03-01	75
486	934764	Goliath	1161-11-01	453
497	109234	Peter	2005-11-01	5
508	9438	Bart	1472-11-01	234
519	111111111	Superman	1776-07-04	65
5210	50000004	Batman	1981-11-01	87423
53alter table t1 drop primary key;
54SELECT * from t1;
55a	b	c	d	e
561	54	zardosht	1986-08-30	3287
572	8709	Alaadin	1789-01-31	8327
583	234	Gilbert	1325-05-21	871233
594	563	Lois	1981-11-06	654
605	587	Lexington	1844-03-01	75
616	934764	Goliath	1161-11-01	453
627	109234	Peter	2005-11-01	5
638	9438	Bart	1472-11-01	234
649	111111111	Superman	1776-07-04	65
6510	50000004	Batman	1981-11-01	87423
66alter table t1 add primary key (e,d,c(3),b,a);
67SELECT * from t1;
68a	b	c	d	e
697	109234	Peter	2005-11-01	5
709	111111111	Superman	1776-07-04	65
715	587	Lexington	1844-03-01	75
728	9438	Bart	1472-11-01	234
736	934764	Goliath	1161-11-01	453
744	563	Lois	1981-11-06	654
751	54	zardosht	1986-08-30	3287
762	8709	Alaadin	1789-01-31	8327
7710	50000004	Batman	1981-11-01	87423
783	234	Gilbert	1325-05-21	871233
79DROP TABLE t1;
80