mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / parts / inc / partition_alter2_1.inc
blob92cbc7ba6e6d3042adc9f392232072dedb458320
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 ################################################################################
17 --echo
18 --echo #========================================================================
19 --echo #  1     Increase the size of the column used in the partitioning
20 --echo #        function and/or PRIMARY KEY and/or UNIQUE INDEX
21 --echo #========================================================================
22 --echo #------------------------------------------------------------------------
23 --echo #  1.1   ALTER column f_int2 not used in partitioning function
24 --echo #------------------------------------------------------------------------
25 #         Rule: Only f_int1 is used within the partitioning function
26 #         ---> inc/partition_alter_11.inc
27 let $alter= ALTER TABLE t1 MODIFY f_int2 BIGINT;
28 --echo #  1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
29 let $unique= ;
30 --source suite/parts/inc/partition_alter_11.inc
32 if ($do_pk_tests)
34    --echo #  1.1.2 PRIMARY KEY exists
35    # The value of the direct following test is maybe covered by the test with
36    # the PRIMARY KEY containing two columns.
37    if ($more_pk_ui_tests)
38    {
39       let $unique= , PRIMARY KEY (f_int1);
40       --source suite/parts/inc/partition_alter_11.inc
41    }
42    let $unique= , PRIMARY KEY (f_int1,f_int2);
43    --source suite/parts/inc/partition_alter_11.inc
44    let $unique= , PRIMARY KEY (f_int2,f_int1);
45    --source suite/parts/inc/partition_alter_11.inc
48 --echo #  1.1.3 UNIQUE INDEX exists
49 # The value of the direct following test is maybe covered by the test with
50 # the UNIQUE INDEX containing two columns
51 if ($more_pk_ui_tests)
53    let $unique= , UNIQUE INDEX uidx1 (f_int1);
54    --source suite/parts/inc/partition_alter_11.inc
56 let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2);
57 --source suite/parts/inc/partition_alter_11.inc
58 let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1);
59 --source suite/parts/inc/partition_alter_11.inc
61 if ($more_pk_ui_tests)
63    # The value of the tests 1.2 is maybe covered by the tests 1.3
64    --echo #------------------------------------------------------------------------
65    --echo #  1.2   ALTER column f_int1 used in partitioning function
66    --echo #------------------------------------------------------------------------
67    #         Rule: Only f_int1 is used within the partitioning function
68    #         ---> inc/partition_alter_11.inc
69    let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT;
70    --echo #  1.2.1 no PRIMARY KEY or UNIQUE INDEX exists
71    let $unique= ;
72    --source suite/parts/inc/partition_alter_11.inc
73    --source suite/parts/inc/partition_alter_13.inc
74    #
75    if ($do_pk_tests)
76    {
77       --echo #  1.2.2 PRIMARY KEY exists
78       let $unique= , PRIMARY KEY (f_int1);
79       --source suite/parts/inc/partition_alter_11.inc
80       let $unique= , PRIMARY KEY (f_int1,f_int2);
81       --source suite/parts/inc/partition_alter_11.inc
82       --source suite/parts/inc/partition_alter_13.inc
83       let $unique= , PRIMARY KEY (f_int2,f_int1);
84       --source suite/parts/inc/partition_alter_11.inc
85       --source suite/parts/inc/partition_alter_13.inc
86    }
87    #
88    --echo #  1.2.3 UNIQUE INDEX exists
89    let $unique= , UNIQUE INDEX uidx (f_int1);
90    --source suite/parts/inc/partition_alter_11.inc
91    let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
92    --source suite/parts/inc/partition_alter_11.inc
93    --source suite/parts/inc/partition_alter_13.inc
94    let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
95    --source suite/parts/inc/partition_alter_11.inc
96    --source suite/parts/inc/partition_alter_13.inc
99 --echo #------------------------------------------------------------------------
100 --echo #  1.3   ALTER column f_int1 and f_int2
101 --echo #        f_int1 or (f_int1 and f_int2) used in partitioning function
102 --echo #------------------------------------------------------------------------
103 #         Rule: f_int1 and f_int2 is used within the partitioning function
104 #         ---> inc/partition_alter_13.inc
105 let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
106 --echo #  1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
107 let $unique= ;
108 --source suite/parts/inc/partition_alter_11.inc
109 --source suite/parts/inc/partition_alter_13.inc
111 if ($do_pk_tests)
113    --echo #  1.3.2 PRIMARY KEY exists
114    # The value of the direct following test is maybe covered by the test with
115    # the PRIMARY KEY containing two columns.
116    if ($more_pk_ui_tests)
117    {
118       let $unique= , PRIMARY KEY (f_int1);
119       --source suite/parts/inc/partition_alter_11.inc
120    }
121    let $unique= , PRIMARY KEY (f_int1,f_int2);
122    --source suite/parts/inc/partition_alter_11.inc
123    --source suite/parts/inc/partition_alter_13.inc
124    let $unique= , PRIMARY KEY (f_int2,f_int1);
125    --source suite/parts/inc/partition_alter_11.inc
126    --source suite/parts/inc/partition_alter_13.inc
129 --echo #  1.3.3 UNIQUE INDEX exists
130 # The value of the direct following test is maybe covered by the test with
131 # the UNIQUE INDEX containing two columns.
132 if ($more_pk_ui_tests)
134    let $unique= , UNIQUE INDEX uidx (f_int1);
135    --source suite/parts/inc/partition_alter_11.inc
137 let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
138 --source suite/parts/inc/partition_alter_11.inc
139 --source suite/parts/inc/partition_alter_13.inc
140 let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
141 --source suite/parts/inc/partition_alter_11.inc
142 --source suite/parts/inc/partition_alter_13.inc
144 if (0)
146 --echo
147 --echo #========================================================================
148 --echo #  3     ALTER the type of the column used in the partitioning
149 --echo #        function and/or PRIMARY KEY and/or UNIQUE INDEX
150 --echo #                   INTEGER --> FLOAT
151 --echo #                   INTEGER --> DECIMAL
152 --echo #                   INTEGER --> VARCHAR
153 --echo #        mleich: I assume that at least the first two variants are of
154 --echo #            some interest. But I am unsure if the server allows such
155 --echo #            conversions. I also think that such operations have a
156 --echo #            conversions very small likelihood.
157 --echo #            To be implemented.
158 --echo #========================================================================