File: partition_blocked_sql_funcs.inc

package info (click to toggle)
mysql-5.1 5.1.73-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 197,132 kB
  • ctags: 93,377
  • sloc: cpp: 579,952; ansic: 429,462; perl: 49,053; sh: 21,692; pascal: 21,272; yacc: 12,801; makefile: 4,545; xml: 4,114; sql: 3,297; lex: 1,265; asm: 1,023
file content (141 lines) | stat: -rw-r--r-- 5,427 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
################################################################################
# t/partition_blocked_sql_funcs.inc                                            #
#                                                                              #
# Purpose:                                                                     #
#  Tests around sql functions                                                  #
#                                                                              #
#                                                                              #
#------------------------------------------------------------------------------#
# Original Author: HH                                                          #
# Original Date: 2006-11-22                                                    #
# Change Author:                                                               #
# Change Date:                                                                 #
# Change:                                                                      #
################################################################################
--echo -------------------------------------------------------------------------
--echo ---  $sqlfunc  in partition with coltype  $coltype
--echo -------------------------------------------------------------------------
--echo must all fail!
--disable_warnings
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
--enable_warnings

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t1 (col1 $coltype) engine=$engine 
partition by range($sqlfunc) 
(partition p0 values less than (15),
 partition p1 values less than (31));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t2 (col1 $coltype) engine=$engine 
partition by list($sqlfunc) 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
 partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 partition p2 values in (21,22,23,24,25,26,27,28,29,30));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t3 (col1 $coltype) engine=$engine 
partition by hash($sqlfunc);

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t4 (colint int, col1 $coltype) engine=$engine 
partition by range(colint) 
subpartition by hash($sqlfunc) subpartitions 2 
(partition p0 values less than (15),
 partition p1 values less than (31));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t5 (colint int, col1 $coltype) engine=$engine 
partition by list(colint)
subpartition by hash($sqlfunc) subpartitions 2 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
 partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 partition p2 values in (21,22,23,24,25,26,27,28,29,30));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t6 (colint int, col1 $coltype) engine=$engine 
partition by range(colint) 
(partition p0 values less than ($valsqlfunc),
 partition p1 values less than maxvalue);

--disable_abort_on_error
--disable_warnings
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
--enable_warnings

eval create table t11 (col1 $coltype) engine=$engine ;

eval create table t22 (col1 $coltype) engine=$engine ;

eval create table t33 (col1 $coltype) engine=$engine ;

eval create table t44 (colint int, col1 $coltype) engine=$engine ;

eval create table t55 (colint int, col1 $coltype) engine=$engine ;

eval create table t66 (colint int, col1 $coltype) engine=$engine ;

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t11  
partition by range($sqlfunc) 
(partition p0 values less than (15),
 partition p1 values less than (31));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t22 
partition by list($sqlfunc) 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
 partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 partition p2 values in (21,22,23,24,25,26,27,28,29,30));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t33 
partition by hash($sqlfunc);
--enable_abort_on_error

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t44 
partition by range(colint) 
subpartition by hash($sqlfunc) subpartitions 2 
(partition p0 values less than (15),
 partition p1 values less than (31));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t55 
partition by list(colint)
subpartition by hash($sqlfunc) subpartitions 2 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
 partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 partition p2 values in (21,22,23,24,25,26,27,28,29,30));

--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t66  
partition by range(colint) 
(partition p0 values less than ($valsqlfunc),
 partition p1 values less than maxvalue);

--disable_warnings
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
--enable_warnings