diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/parts/inc/partition_syntax_1.inc | |
parent | Initial commit. (diff) | |
download | mariadb-upstream.tar.xz mariadb-upstream.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/parts/inc/partition_syntax_1.inc')
-rw-r--r-- | mysql-test/suite/parts/inc/partition_syntax_1.inc | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/mysql-test/suite/parts/inc/partition_syntax_1.inc b/mysql-test/suite/parts/inc/partition_syntax_1.inc new file mode 100644 index 00000000..a7168b6a --- /dev/null +++ b/mysql-test/suite/parts/inc/partition_syntax_1.inc @@ -0,0 +1,85 @@ +################################################################################ +# inc/partition_syntax_1.inc # +# # +# Purpose: # +# Auxiliary script, only useful when sourced by inc/partition_syntax.inc # +# # +# Try to create a table with number of partitions/subpartitions # +# = $part_number. Print the layout of the table and drop it. # +# # +# The parameter $part_number must be set before sourcing this script. # +# # +#------------------------------------------------------------------------------# +# Original Author: mleich # +# Original Date: 2006-03-05 # +# Change Author: mleich # +# Change Date: 2007-10-08 # +# Change: Fix for # +# Bug#31481 test suite parts: Many tests fail because of # +# changed server error codes # +################################################################################ + +--disable_abort_on_error +eval CREATE TABLE t1 ( +$column_list +) +PARTITION BY HASH(f_int1) PARTITIONS $part_number; +--enable_abort_on_error +--disable_query_log +eval SET @my_errno= $mysql_errno ; +let $run= `SELECT @my_errno = 0`; +# Expected error codes are +# 0, ER_PARSE_ERROR (Reason: assign -1 partitions), ER_TOO_MANY_PARTITIONS_ERROR +# and ER_NO_PARTS_ERROR +if (`SELECT @my_errno NOT IN (0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR, + $ER_NO_PARTS_ERROR)`) +{ + --echo # The last command got an unexepected error response. + --echo # Expected/handled SQL codes are 0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,$ER_NO_PARTS_ERROR + SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; + --echo # Sorry, have to abort. + exit; + --echo +} +--enable_query_log +# +# If this operation was successfull, print layout + drop this table +if ($run) +{ + --source suite/parts/inc/partition_layout_check1.inc + eval DROP TABLE t1; +} +#### Try to create a table with the given subpartition number +--disable_abort_on_error +eval CREATE TABLE t1 ( +$column_list +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS $part_number +(PARTITION part1 VALUES LESS THAN ($max_row_div2), + PARTITION part2 VALUES LESS THAN $MAX_VALUE); +--enable_abort_on_error +--disable_query_log +eval SET @my_errno= $mysql_errno ; +let $run= `SELECT @my_errno = 0`; +# Expected error codes are +# 0, ER_PARSE_ERROR (Reason: assign -1 partitions), ER_TOO_MANY_PARTITIONS_ERROR +# and ER_NO_PARTS_ERROR +if (`SELECT @my_errno NOT IN (0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR, + $ER_NO_PARTS_ERROR)`) +{ + --echo # The last command got an unexepected error response. + --echo # Expected/handled SQL codes are 0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,$ER_NO_PARTS_ERROR + SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; + --echo # Sorry, have to abort. + exit; + --echo +} +--enable_query_log +# +# If this operation was successfull, print layout + drop this table +if ($run) +{ + --source suite/parts/inc/partition_layout_check1.inc + eval DROP TABLE t1; +} |