1
################################################################################
2
# t/partition_blocked_sql_funcs.inc #
5
# Tests around sql functions #
8
#------------------------------------------------------------------------------#
9
# Original Author: HH #
10
# Original Date: 2006-11-22 #
14
################################################################################
15
--echo -------------------------------------------------------------------------
16
--echo --- $sqlfunc in partition with coltype $coltype
17
--echo -------------------------------------------------------------------------
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 ;
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));
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));
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);
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));
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));
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);
66
--disable_abort_on_error
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 ;
76
eval create table t11 (col1 $coltype) engine=$engine ;
78
eval create table t22 (col1 $coltype) engine=$engine ;
80
eval create table t33 (col1 $coltype) engine=$engine ;
82
eval create table t44 (colint int, col1 $coltype) engine=$engine ;
84
eval create table t55 (colint int, col1 $coltype) engine=$engine ;
86
eval create table t66 (colint int, col1 $coltype) engine=$engine ;
88
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
90
partition by range($sqlfunc)
91
(partition p0 values less than (15),
92
partition p1 values less than (31));
94
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
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));
101
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
103
partition by hash($sqlfunc);
104
--enable_abort_on_error
106
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
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));
113
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
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));
121
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
123
partition by range(colint)
124
(partition p0 values less than ($valsqlfunc),
125
partition p1 values less than maxvalue);
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 ;