1SET DEFAULT_STORAGE_ENGINE='tokudb';
2*** Bug #22169 ***
3DROP TABLE IF EXISTS t1;
4CREATE TABLE t1 (a int, b bigint, c char(10), 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 (b);
41SELECT * from t1;
42a	b	c	d	e
431	54	zardosht	1986-08-30	3287
443	234	Gilbert	1325-05-21	871233
454	563	Lois	1981-11-06	654
465	587	Lexington	1844-03-01	75
472	8709	Alaadin	1789-01-31	8327
488	9438	Bart	1472-11-01	234
497	109234	Peter	2005-11-01	5
506	934764	Goliath	1161-11-01	453
5110	50000004	Batman	1981-11-01	87423
529	111111111	Superman	1776-07-04	65
53alter table t1 drop primary key;
54SELECT * from t1;
55a	b	c	d	e
561	54	zardosht	1986-08-30	3287
573	234	Gilbert	1325-05-21	871233
584	563	Lois	1981-11-06	654
595	587	Lexington	1844-03-01	75
602	8709	Alaadin	1789-01-31	8327
618	9438	Bart	1472-11-01	234
627	109234	Peter	2005-11-01	5
636	934764	Goliath	1161-11-01	453
6410	50000004	Batman	1981-11-01	87423
659	111111111	Superman	1776-07-04	65
66alter table t1 add primary key (c);
67SELECT * from t1;
68a	b	c	d	e
692	8709	Alaadin	1789-01-31	8327
708	9438	Bart	1472-11-01	234
7110	50000004	Batman	1981-11-01	87423
723	234	Gilbert	1325-05-21	871233
736	934764	Goliath	1161-11-01	453
745	587	Lexington	1844-03-01	75
754	563	Lois	1981-11-06	654
767	109234	Peter	2005-11-01	5
779	111111111	Superman	1776-07-04	65
781	54	zardosht	1986-08-30	3287
79alter table t1 drop primary key;
80SELECT * from t1;
81a	b	c	d	e
822	8709	Alaadin	1789-01-31	8327
838	9438	Bart	1472-11-01	234
8410	50000004	Batman	1981-11-01	87423
853	234	Gilbert	1325-05-21	871233
866	934764	Goliath	1161-11-01	453
875	587	Lexington	1844-03-01	75
884	563	Lois	1981-11-06	654
897	109234	Peter	2005-11-01	5
909	111111111	Superman	1776-07-04	65
911	54	zardosht	1986-08-30	3287
92alter table t1 add primary key (d);
93SELECT * from t1;
94a	b	c	d	e
956	934764	Goliath	1161-11-01	453
963	234	Gilbert	1325-05-21	871233
978	9438	Bart	1472-11-01	234
989	111111111	Superman	1776-07-04	65
992	8709	Alaadin	1789-01-31	8327
1005	587	Lexington	1844-03-01	75
10110	50000004	Batman	1981-11-01	87423
1024	563	Lois	1981-11-06	654
1031	54	zardosht	1986-08-30	3287
1047	109234	Peter	2005-11-01	5
105alter table t1 drop primary key;
106SELECT * from t1;
107a	b	c	d	e
1086	934764	Goliath	1161-11-01	453
1093	234	Gilbert	1325-05-21	871233
1108	9438	Bart	1472-11-01	234
1119	111111111	Superman	1776-07-04	65
1122	8709	Alaadin	1789-01-31	8327
1135	587	Lexington	1844-03-01	75
11410	50000004	Batman	1981-11-01	87423
1154	563	Lois	1981-11-06	654
1161	54	zardosht	1986-08-30	3287
1177	109234	Peter	2005-11-01	5
118alter table t1 add primary key (e);
119SELECT * from t1;
120a	b	c	d	e
1217	109234	Peter	2005-11-01	5
1229	111111111	Superman	1776-07-04	65
1235	587	Lexington	1844-03-01	75
1248	9438	Bart	1472-11-01	234
1256	934764	Goliath	1161-11-01	453
1264	563	Lois	1981-11-06	654
1271	54	zardosht	1986-08-30	3287
1282	8709	Alaadin	1789-01-31	8327
12910	50000004	Batman	1981-11-01	87423
1303	234	Gilbert	1325-05-21	871233
131alter table t1 drop primary key;
132SELECT * from t1;
133a	b	c	d	e
1347	109234	Peter	2005-11-01	5
1359	111111111	Superman	1776-07-04	65
1365	587	Lexington	1844-03-01	75
1378	9438	Bart	1472-11-01	234
1386	934764	Goliath	1161-11-01	453
1394	563	Lois	1981-11-06	654
1401	54	zardosht	1986-08-30	3287
1412	8709	Alaadin	1789-01-31	8327
14210	50000004	Batman	1981-11-01	87423
1433	234	Gilbert	1325-05-21	871233
144alter table t1 add primary key (a,b);
145SELECT * from t1;
146a	b	c	d	e
1471	54	zardosht	1986-08-30	3287
1482	8709	Alaadin	1789-01-31	8327
1493	234	Gilbert	1325-05-21	871233
1504	563	Lois	1981-11-06	654
1515	587	Lexington	1844-03-01	75
1526	934764	Goliath	1161-11-01	453
1537	109234	Peter	2005-11-01	5
1548	9438	Bart	1472-11-01	234
1559	111111111	Superman	1776-07-04	65
15610	50000004	Batman	1981-11-01	87423
157alter table t1 drop primary key;
158SELECT * from t1;
159a	b	c	d	e
1601	54	zardosht	1986-08-30	3287
1612	8709	Alaadin	1789-01-31	8327
1623	234	Gilbert	1325-05-21	871233
1634	563	Lois	1981-11-06	654
1645	587	Lexington	1844-03-01	75
1656	934764	Goliath	1161-11-01	453
1667	109234	Peter	2005-11-01	5
1678	9438	Bart	1472-11-01	234
1689	111111111	Superman	1776-07-04	65
16910	50000004	Batman	1981-11-01	87423
170alter table t1 add primary key (a,c);
171SELECT * from t1;
172a	b	c	d	e
1731	54	zardosht	1986-08-30	3287
1742	8709	Alaadin	1789-01-31	8327
1753	234	Gilbert	1325-05-21	871233
1764	563	Lois	1981-11-06	654
1775	587	Lexington	1844-03-01	75
1786	934764	Goliath	1161-11-01	453
1797	109234	Peter	2005-11-01	5
1808	9438	Bart	1472-11-01	234
1819	111111111	Superman	1776-07-04	65
18210	50000004	Batman	1981-11-01	87423
183alter table t1 drop primary key;
184SELECT * from t1;
185a	b	c	d	e
1861	54	zardosht	1986-08-30	3287
1872	8709	Alaadin	1789-01-31	8327
1883	234	Gilbert	1325-05-21	871233
1894	563	Lois	1981-11-06	654
1905	587	Lexington	1844-03-01	75
1916	934764	Goliath	1161-11-01	453
1927	109234	Peter	2005-11-01	5
1938	9438	Bart	1472-11-01	234
1949	111111111	Superman	1776-07-04	65
19510	50000004	Batman	1981-11-01	87423
196alter table t1 add primary key (b,d);
197SELECT * from t1;
198a	b	c	d	e
1991	54	zardosht	1986-08-30	3287
2003	234	Gilbert	1325-05-21	871233
2014	563	Lois	1981-11-06	654
2025	587	Lexington	1844-03-01	75
2032	8709	Alaadin	1789-01-31	8327
2048	9438	Bart	1472-11-01	234
2057	109234	Peter	2005-11-01	5
2066	934764	Goliath	1161-11-01	453
20710	50000004	Batman	1981-11-01	87423
2089	111111111	Superman	1776-07-04	65
209alter table t1 drop primary key;
210SELECT * from t1;
211a	b	c	d	e
2121	54	zardosht	1986-08-30	3287
2133	234	Gilbert	1325-05-21	871233
2144	563	Lois	1981-11-06	654
2155	587	Lexington	1844-03-01	75
2162	8709	Alaadin	1789-01-31	8327
2178	9438	Bart	1472-11-01	234
2187	109234	Peter	2005-11-01	5
2196	934764	Goliath	1161-11-01	453
22010	50000004	Batman	1981-11-01	87423
2219	111111111	Superman	1776-07-04	65
222alter table t1 add primary key (d,e);
223SELECT * from t1;
224a	b	c	d	e
2256	934764	Goliath	1161-11-01	453
2263	234	Gilbert	1325-05-21	871233
2278	9438	Bart	1472-11-01	234
2289	111111111	Superman	1776-07-04	65
2292	8709	Alaadin	1789-01-31	8327
2305	587	Lexington	1844-03-01	75
23110	50000004	Batman	1981-11-01	87423
2324	563	Lois	1981-11-06	654
2331	54	zardosht	1986-08-30	3287
2347	109234	Peter	2005-11-01	5
235alter table t1 drop primary key;
236SELECT * from t1;
237a	b	c	d	e
2386	934764	Goliath	1161-11-01	453
2393	234	Gilbert	1325-05-21	871233
2408	9438	Bart	1472-11-01	234
2419	111111111	Superman	1776-07-04	65
2422	8709	Alaadin	1789-01-31	8327
2435	587	Lexington	1844-03-01	75
24410	50000004	Batman	1981-11-01	87423
2454	563	Lois	1981-11-06	654
2461	54	zardosht	1986-08-30	3287
2477	109234	Peter	2005-11-01	5
248alter table t1 add primary key (d,b);
249SELECT * from t1;
250a	b	c	d	e
2516	934764	Goliath	1161-11-01	453
2523	234	Gilbert	1325-05-21	871233
2538	9438	Bart	1472-11-01	234
2549	111111111	Superman	1776-07-04	65
2552	8709	Alaadin	1789-01-31	8327
2565	587	Lexington	1844-03-01	75
25710	50000004	Batman	1981-11-01	87423
2584	563	Lois	1981-11-06	654
2591	54	zardosht	1986-08-30	3287
2607	109234	Peter	2005-11-01	5
261alter table t1 drop primary key;
262SELECT * from t1;
263a	b	c	d	e
2646	934764	Goliath	1161-11-01	453
2653	234	Gilbert	1325-05-21	871233
2668	9438	Bart	1472-11-01	234
2679	111111111	Superman	1776-07-04	65
2682	8709	Alaadin	1789-01-31	8327
2695	587	Lexington	1844-03-01	75
27010	50000004	Batman	1981-11-01	87423
2714	563	Lois	1981-11-06	654
2721	54	zardosht	1986-08-30	3287
2737	109234	Peter	2005-11-01	5
274alter table t1 add primary key (e,a,c);
275SELECT * from t1;
276a	b	c	d	e
2777	109234	Peter	2005-11-01	5
2789	111111111	Superman	1776-07-04	65
2795	587	Lexington	1844-03-01	75
2808	9438	Bart	1472-11-01	234
2816	934764	Goliath	1161-11-01	453
2824	563	Lois	1981-11-06	654
2831	54	zardosht	1986-08-30	3287
2842	8709	Alaadin	1789-01-31	8327
28510	50000004	Batman	1981-11-01	87423
2863	234	Gilbert	1325-05-21	871233
287alter table t1 drop primary key;
288SELECT * from t1;
289a	b	c	d	e
2907	109234	Peter	2005-11-01	5
2919	111111111	Superman	1776-07-04	65
2925	587	Lexington	1844-03-01	75
2938	9438	Bart	1472-11-01	234
2946	934764	Goliath	1161-11-01	453
2954	563	Lois	1981-11-06	654
2961	54	zardosht	1986-08-30	3287
2972	8709	Alaadin	1789-01-31	8327
29810	50000004	Batman	1981-11-01	87423
2993	234	Gilbert	1325-05-21	871233
300alter table t1 add primary key (a,b,c,d,e);
301SELECT * from t1;
302a	b	c	d	e
3031	54	zardosht	1986-08-30	3287
3042	8709	Alaadin	1789-01-31	8327
3053	234	Gilbert	1325-05-21	871233
3064	563	Lois	1981-11-06	654
3075	587	Lexington	1844-03-01	75
3086	934764	Goliath	1161-11-01	453
3097	109234	Peter	2005-11-01	5
3108	9438	Bart	1472-11-01	234
3119	111111111	Superman	1776-07-04	65
31210	50000004	Batman	1981-11-01	87423
313alter table t1 drop primary key;
314SELECT * from t1;
315a	b	c	d	e
3161	54	zardosht	1986-08-30	3287
3172	8709	Alaadin	1789-01-31	8327
3183	234	Gilbert	1325-05-21	871233
3194	563	Lois	1981-11-06	654
3205	587	Lexington	1844-03-01	75
3216	934764	Goliath	1161-11-01	453
3227	109234	Peter	2005-11-01	5
3238	9438	Bart	1472-11-01	234
3249	111111111	Superman	1776-07-04	65
32510	50000004	Batman	1981-11-01	87423
326alter table t1 add primary key (e,d,c,b,a);
327SELECT * from t1;
328a	b	c	d	e
3297	109234	Peter	2005-11-01	5
3309	111111111	Superman	1776-07-04	65
3315	587	Lexington	1844-03-01	75
3328	9438	Bart	1472-11-01	234
3336	934764	Goliath	1161-11-01	453
3344	563	Lois	1981-11-06	654
3351	54	zardosht	1986-08-30	3287
3362	8709	Alaadin	1789-01-31	8327
33710	50000004	Batman	1981-11-01	87423
3383	234	Gilbert	1325-05-21	871233
339alter table t1 drop primary key;
340SELECT * from t1;
341a	b	c	d	e
3427	109234	Peter	2005-11-01	5
3439	111111111	Superman	1776-07-04	65
3445	587	Lexington	1844-03-01	75
3458	9438	Bart	1472-11-01	234
3466	934764	Goliath	1161-11-01	453
3474	563	Lois	1981-11-06	654
3481	54	zardosht	1986-08-30	3287
3492	8709	Alaadin	1789-01-31	8327
35010	50000004	Batman	1981-11-01	87423
3513	234	Gilbert	1325-05-21	871233
352alter table t1 add primary key (e,a,d,b,c);
353SELECT * from t1;
354a	b	c	d	e
3557	109234	Peter	2005-11-01	5
3569	111111111	Superman	1776-07-04	65
3575	587	Lexington	1844-03-01	75
3588	9438	Bart	1472-11-01	234
3596	934764	Goliath	1161-11-01	453
3604	563	Lois	1981-11-06	654
3611	54	zardosht	1986-08-30	3287
3622	8709	Alaadin	1789-01-31	8327
36310	50000004	Batman	1981-11-01	87423
3643	234	Gilbert	1325-05-21	871233
365DROP TABLE t1;
366