1 ################################################################################
2 # inc/partition_syntax_1.inc #
5 # Auxiliary script, only useful when sourced by inc/partition_syntax.inc #
7 # Try to create a table with number of partitions/subpartitions #
8 # = $part_number. Print the layout of the table and drop it. #
10 # The parameter $part_number must be set before sourcing this script. #
12 #------------------------------------------------------------------------------#
13 # Original Author: mleich #
14 # Original Date: 2006-03-05 #
15 # Change Author: mleich #
16 # Change Date: 2007-10-08 #
18 # Bug#31481 test suite parts: Many tests fail because of #
19 # changed server error codes #
20 ################################################################################
22 --disable_abort_on_error
23 eval CREATE
TABLE t1 (
26 PARTITION BY
HASH(f_int1) PARTITIONS $part_number;
27 --enable_abort_on_error
29 eval SET @my_errno= $mysql_errno ;
30 let $run= `SELECT @my_errno = 0`;
31 # Expected error codes are
32 # 0, ER_PARSE_ERROR (Reason: assign -1 partitions), ER_TOO_MANY_PARTITIONS_ERROR
33 # and ER_NO_PARTS_ERROR
34 if (`SELECT @my_errno NOT IN (0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,
37 --echo # The last command got an unexepected error response.
38 --echo # Expected/handled SQL codes are 0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,$ER_NO_PARTS_ERROR
39 SELECT
'# SQL code we got was: ' AS
"", @my_errno AS
"";
40 --echo # Sorry, have
to abort.
46 # If this operation was successfull, print layout + drop this table
49 --source suite/parts/inc/partition_layout_check1.inc
52 #### Try to create a table with the given subpartition number
53 --disable_abort_on_error
54 eval CREATE
TABLE t1 (
57 PARTITION BY RANGE(f_int1) SUBPARTITION BY
HASH(f_int1)
58 SUBPARTITIONS $part_number
59 (PARTITION part1 VALUES LESS THAN ($max_row_div2),
60 PARTITION part2 VALUES LESS THAN $MAX_VALUE);
61 --enable_abort_on_error
63 eval SET @my_errno= $mysql_errno ;
64 let $run= `SELECT @my_errno = 0`;
65 # Expected error codes are
66 # 0, ER_PARSE_ERROR (Reason: assign -1 partitions), ER_TOO_MANY_PARTITIONS_ERROR
67 # and ER_NO_PARTS_ERROR
68 if (`SELECT @my_errno NOT IN (0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,
71 --echo # The last command got an unexepected error response.
72 --echo # Expected/handled SQL codes are 0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,$ER_NO_PARTS_ERROR
73 SELECT
'# SQL code we got was: ' AS
"", @my_errno AS
"";
74 --echo # Sorry, have
to abort.
80 # If this operation was successfull, print layout + drop this table
83 --source suite/parts/inc/partition_layout_check1.inc