MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_blocked_sql_funcs.inc
1 ################################################################################
2 # t/partition_blocked_sql_funcs.inc #
3 # #
4 # Purpose: #
5 # Tests around sql functions #
6 # #
7 # #
8 #------------------------------------------------------------------------------#
9 # Original Author: HH #
10 # Original Date: 2006-11-22 #
11 # Change Author: #
12 # Change Date: #
13 # Change: #
14 ################################################################################
15 --echo -------------------------------------------------------------------------
16 --echo --- $sqlfunc in partition with coltype $coltype
17 --echo -------------------------------------------------------------------------
18 --echo must all fail!
19 --disable_warnings
20 drop table if exists t1 ;
21 drop table if exists t2 ;
22 drop table if exists t3 ;
23 drop table if exists t4 ;
24 drop table if exists t5 ;
25 drop table if exists t6 ;
26 --enable_warnings
27 
28 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
29 eval create table t1 (col1 $coltype) engine=$engine
30 partition by range($sqlfunc)
31 (partition p0 values less than (15),
32  partition p1 values less than (31));
33 
34 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
35 eval create table t2 (col1 $coltype) engine=$engine
36 partition by list($sqlfunc)
37 (partition p0 values in (1,2,3,4,5,6,7,8,9,10),
38  partition p1 values in (11,12,13,14,15,16,17,18,19,20),
39  partition p2 values in (21,22,23,24,25,26,27,28,29,30));
40 
41 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
42 eval create table t3 (col1 $coltype) engine=$engine
43 partition by hash($sqlfunc);
44 
45 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
46 eval create table t4 (colint int, col1 $coltype) engine=$engine
47 partition by range(colint)
48 subpartition by hash($sqlfunc) subpartitions 2
49 (partition p0 values less than (15),
50  partition p1 values less than (31));
51 
52 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
53 eval create table t5 (colint int, col1 $coltype) engine=$engine
54 partition by list(colint)
55 subpartition by hash($sqlfunc) subpartitions 2
56 (partition p0 values in (1,2,3,4,5,6,7,8,9,10),
57  partition p1 values in (11,12,13,14,15,16,17,18,19,20),
58  partition p2 values in (21,22,23,24,25,26,27,28,29,30));
59 
60 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
61 eval create table t6 (colint int, col1 $coltype) engine=$engine
62 partition by range(colint)
63 (partition p0 values less than ($valsqlfunc),
64  partition p1 values less than maxvalue);
65 
66 --disable_abort_on_error
67 --disable_warnings
68 drop table if exists t11 ;
69 drop table if exists t22 ;
70 drop table if exists t33 ;
71 drop table if exists t44 ;
72 drop table if exists t55 ;
73 drop table if exists t66 ;
74 --enable_warnings
75 
76 eval create table t11 (col1 $coltype) engine=$engine ;
77 
78 eval create table t22 (col1 $coltype) engine=$engine ;
79 
80 eval create table t33 (col1 $coltype) engine=$engine ;
81 
82 eval create table t44 (colint int, col1 $coltype) engine=$engine ;
83 
84 eval create table t55 (colint int, col1 $coltype) engine=$engine ;
85 
86 eval create table t66 (colint int, col1 $coltype) engine=$engine ;
87 
88 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
89 eval alter table t11
90 partition by range($sqlfunc)
91 (partition p0 values less than (15),
92  partition p1 values less than (31));
93 
94 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
95 eval alter table t22
96 partition by list($sqlfunc)
97 (partition p0 values in (1,2,3,4,5,6,7,8,9,10),
98  partition p1 values in (11,12,13,14,15,16,17,18,19,20),
99  partition p2 values in (21,22,23,24,25,26,27,28,29,30));
100 
101 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
102 eval alter table t33
103 partition by hash($sqlfunc);
104 --enable_abort_on_error
105 
106 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
107 eval alter table t44
108 partition by range(colint)
109 subpartition by hash($sqlfunc) subpartitions 2
110 (partition p0 values less than (15),
111  partition p1 values less than (31));
112 
113 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
114 eval alter table t55
115 partition by list(colint)
116 subpartition by hash($sqlfunc) subpartitions 2
117 (partition p0 values in (1,2,3,4,5,6,7,8,9,10),
118  partition p1 values in (11,12,13,14,15,16,17,18,19,20),
119  partition p2 values in (21,22,23,24,25,26,27,28,29,30));
120 
121 --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
122 eval alter table t66
123 partition by range(colint)
124 (partition p0 values less than ($valsqlfunc),
125  partition p1 values less than maxvalue);
126 
127 --disable_warnings
128 drop table if exists t1 ;
129 drop table if exists t2 ;
130 drop table if exists t3 ;
131 drop table if exists t4 ;
132 drop table if exists t5 ;
133 drop table if exists t6 ;
134 drop table if exists t11 ;
135 drop table if exists t22 ;
136 drop table if exists t33 ;
137 drop table if exists t44 ;
138 drop table if exists t55 ;
139 drop table if exists t66 ;
140 --enable_warnings
141