MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_alter1_1_2.inc
1 ################################################################################
2 # inc/partition_alter1_1_2.inc #
3 # #
4 # Purpose: #
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. #
7 # #
8 #------------------------------------------------------------------------------#
9 # Original Author: mleich #
10 # Original Date: 2006-03-05 #
11 # Change Author: #
12 # Change Date: #
13 # Change: #
14 ################################################################################
15 
16 --echo
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.
24 #
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
31 if ($do_pk_tests)
32 {
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
38 }
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
44 if ($do_pk_tests)
45 {
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
51  let $unique= ;
52  --source suite/parts/inc/partition_alter_13.inc
53 }
54