1 ################################################################################
2 # inc/partition_alter1_1_2.inc #
5 # ADD/DROP PRIMARY KEYs and/or UNIQUE INDEXes tests on partitioned tables #
6 # This routine is only useful for the partition_<feature>_<engine> tests. #
8 #------------------------------------------------------------------------------#
9 # Original Author: mleich #
10 # Original Date: 2006-03-05 #
14 ################################################################################
17 --echo #========================================================================
18 --echo # 1. ALTER
TABLE ADD PRIMARY
KEY and/or UNIQUE INDEX
19 --echo #========================================================================
20 # Rule: The table does not have a PRIMARY KEY or UNIQUE INDEX.
21 # ---> $unique must be empty
22 # ---> The PRIMARY KEY or UNIQUE INDEX to be created must contain
23 # the columns used for partitioning.
25 --echo #------------------------------------------------------------------------
26 --echo # 1.2 ADD PRIMARY
KEY or UNIQUE INDEX
to table with two columns
27 --echo # (f_int1 and f_int2) within the partitioning
function
28 --echo #------------------------------------------------------------------------
29 # Rule: f_int1 and f_int2 is used within the partitioning
function
30 # ---> inc/partition_alter_13.inc
33 --echo # 1.2.1 PRIMARY
KEY consisting of two columns
34 let $alter= ALTER
TABLE t1 ADD PRIMARY
KEY(f_int1,f_int2);
35 --source suite/parts/inc/partition_alter_13.inc
36 let $alter= ALTER
TABLE t1 ADD PRIMARY
KEY(f_int2,f_int1);
37 --source suite/parts/inc/partition_alter_13.inc
39 --echo # 1.2.2 UNIQUE INDEX consisting of two columns
40 let $alter= ALTER
TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
41 --source suite/parts/inc/partition_alter_13.inc
42 let $alter= ALTER
TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
43 --source suite/parts/inc/partition_alter_13.inc
46 --echo # 1.2.3 PRIMARY
KEY and UNIQUE INDEX consisting of two columns
47 let $alter= ALTER
TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY
KEY(f_int2,f_int1);
48 --source suite/parts/inc/partition_alter_13.inc
49 let $alter= ALTER
TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY
KEY(f_int1,f_int2);
50 --source suite/parts/inc/partition_alter_13.inc
52 --source suite/parts/inc/partition_alter_13.inc