MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_alter2_1.inc
1 ################################################################################
2 # inc/partition_alter2_1.inc #
3 # #
4 # Purpose: #
5 # Tests where the columns used within the partitioning function are altered. #
6 # This routine is only useful for the partition_<feature>_<engine> tests. .#
7 # Part 1: increasing size of column
8 # #
9 #------------------------------------------------------------------------------#
10 # Original Author: mleich #
11 # Original Date: 2006-03-05 #
12 # Change Author: MattiasJ #
13 # Change Date: 2008-09-08 #
14 # Change: Splitted the test in two different parts (increasing/decreasing col) #
15 ################################################################################
16 
17 if (!$only_part_2)
18 {
19 --echo
20 --echo #========================================================================
21 --echo # 1 Increase the size of the column used in the partitioning
22 --echo # function and/or PRIMARY KEY and/or UNIQUE INDEX
23 --echo #========================================================================
24 --echo #------------------------------------------------------------------------
25 --echo # 1.1 ALTER column f_int2 not used in partitioning function
26 --echo #------------------------------------------------------------------------
27 # Rule: Only f_int1 is used within the partitioning function
28 # ---> inc/partition_alter_11.inc
29 let $alter= ALTER TABLE t1 MODIFY f_int2 BIGINT;
30 --echo # 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
31 let $unique= ;
32 --source suite/parts/inc/partition_alter_11.inc
33 #
34 if ($do_pk_tests)
35 {
36  --echo # 1.1.2 PRIMARY KEY exists
37  # The value of the direct following test is maybe covered by the test with
38  # the PRIMARY KEY containing two columns.
39  if ($more_pk_ui_tests)
40  {
41  let $unique= , PRIMARY KEY (f_int1);
42  --source suite/parts/inc/partition_alter_11.inc
43  }
44  let $unique= , PRIMARY KEY (f_int1,f_int2);
45  --source suite/parts/inc/partition_alter_11.inc
46  let $unique= , PRIMARY KEY (f_int2,f_int1);
47  --source suite/parts/inc/partition_alter_11.inc
48 }
49 #
50 --echo # 1.1.3 UNIQUE INDEX exists
51 # The value of the direct following test is maybe covered by the test with
52 # the UNIQUE INDEX containing two columns
53 if ($more_pk_ui_tests)
54 {
55  let $unique= , UNIQUE INDEX uidx1 (f_int1);
56  --source suite/parts/inc/partition_alter_11.inc
57 }
58 let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2);
59 --source suite/parts/inc/partition_alter_11.inc
60 let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1);
61 --source suite/parts/inc/partition_alter_11.inc
62 #
63 if ($more_pk_ui_tests)
64 {
65  # The value of the tests 1.2 is maybe covered by the tests 1.3
66  --echo #------------------------------------------------------------------------
67  --echo # 1.2 ALTER column f_int1 used in partitioning function
68  --echo #------------------------------------------------------------------------
69  # Rule: Only f_int1 is used within the partitioning function
70  # ---> inc/partition_alter_11.inc
71  let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT;
72  --echo # 1.2.1 no PRIMARY KEY or UNIQUE INDEX exists
73  let $unique= ;
74  --source suite/parts/inc/partition_alter_11.inc
75  --source suite/parts/inc/partition_alter_13.inc
76  #
77  if ($do_pk_tests)
78  {
79  --echo # 1.2.2 PRIMARY KEY exists
80  let $unique= , PRIMARY KEY (f_int1);
81  --source suite/parts/inc/partition_alter_11.inc
82  let $unique= , PRIMARY KEY (f_int1,f_int2);
83  --source suite/parts/inc/partition_alter_11.inc
84  --source suite/parts/inc/partition_alter_13.inc
85  let $unique= , PRIMARY KEY (f_int2,f_int1);
86  --source suite/parts/inc/partition_alter_11.inc
87  --source suite/parts/inc/partition_alter_13.inc
88  }
89  #
90  --echo # 1.2.3 UNIQUE INDEX exists
91  let $unique= , UNIQUE INDEX uidx (f_int1);
92  --source suite/parts/inc/partition_alter_11.inc
93  let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
94  #--source suite/parts/inc/partition_alter_11.inc
95  --source suite/parts/inc/partition_alter_13.inc
96  let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
97  #--source suite/parts/inc/partition_alter_11.inc
98  --source suite/parts/inc/partition_alter_13.inc
99 }
100 }
101 #
102 if (!$only_part_1)
103 {
104 --echo #------------------------------------------------------------------------
105 --echo # 1.3 ALTER column f_int1 and f_int2
106 --echo # f_int1 or (f_int1 and f_int2) used in partitioning function
107 --echo #------------------------------------------------------------------------
108 # Rule: f_int1 and f_int2 is used within the partitioning function
109 # ---> inc/partition_alter_13.inc
110 let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
111 --echo # 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
112 let $unique= ;
113 #--source suite/parts/inc/partition_alter_11.inc
114 --source suite/parts/inc/partition_alter_13.inc
115 #
116 if ($do_pk_tests)
117 {
118  --echo # 1.3.2 PRIMARY KEY exists
119  # The value of the direct following test is maybe covered by the test with
120  # the PRIMARY KEY containing two columns.
121  if ($more_pk_ui_tests)
122  {
123  let $unique= , PRIMARY KEY (f_int1);
124  --source suite/parts/inc/partition_alter_11.inc
125  }
126  let $unique= , PRIMARY KEY (f_int1,f_int2);
127  #--source suite/parts/inc/partition_alter_11.inc
128  --source suite/parts/inc/partition_alter_13.inc
129  let $unique= , PRIMARY KEY (f_int2,f_int1);
130  #--source suite/parts/inc/partition_alter_11.inc
131  --source suite/parts/inc/partition_alter_13.inc
132 }
133 #
134 --echo # 1.3.3 UNIQUE INDEX exists
135 # The value of the direct following test is maybe covered by the test with
136 # the UNIQUE INDEX containing two columns.
137 if ($more_pk_ui_tests)
138 {
139  let $unique= , UNIQUE INDEX uidx (f_int1);
140  --source suite/parts/inc/partition_alter_11.inc
141 }
142 let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
143 #--source suite/parts/inc/partition_alter_11.inc
144 --source suite/parts/inc/partition_alter_13.inc
145 let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
146 #--source suite/parts/inc/partition_alter_11.inc
147 --source suite/parts/inc/partition_alter_13.inc
148 }
149 
150 if (0)
151 {
152 --echo
153 --echo #========================================================================
154 --echo # 3 ALTER the type of the column used in the partitioning
155 --echo # function and/or PRIMARY KEY and/or UNIQUE INDEX
156 --echo # INTEGER --> FLOAT
157 --echo # INTEGER --> DECIMAL
158 --echo # INTEGER --> VARCHAR
159 --echo # mleich: I assume that at least the first two variants are of
160 --echo # some interest. But I am unsure if the server allows such
161 --echo # conversions. I also think that such operations have a
162 --echo # conversions very small likelihood.
163 --echo # To be implemented.
164 --echo #========================================================================
165 }