mariadb/mysql-test/suite/parts/inc/partition_syntax.inc
unknown 3df9f94f35 shorten filenames
mysql-test/suite/parts/r/ndb_blob_partition.result:
  Rename: mysql-test/suite/partitions/r/ndb_blob_partition.result -> mysql-test/suite/parts/r/ndb_blob_partition.result
mysql-test/suite/parts/r/ndb_dd_backuprestore.result:
  Rename: mysql-test/suite/partitions/r/ndb_dd_backuprestore.result -> mysql-test/suite/parts/r/ndb_dd_backuprestore.result
mysql-test/suite/parts/r/ndb_partition_error.result:
  Rename: mysql-test/suite/partitions/r/ndb_partition_error.result -> mysql-test/suite/parts/r/ndb_partition_error.result
mysql-test/suite/parts/r/ndb_partition_list.result:
  Rename: mysql-test/suite/partitions/r/ndb_partition_list.result -> mysql-test/suite/parts/r/ndb_partition_list.result
mysql-test/suite/parts/r/ndb_partition_range.result:
  Rename: mysql-test/suite/partitions/r/ndb_partition_range.result -> mysql-test/suite/parts/r/ndb_partition_range.result
mysql-test/suite/parts/r/partition_alter1_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_alter1_innodb.result -> mysql-test/suite/parts/r/partition_alter1_innodb.result
mysql-test/suite/parts/r/partition_alter1_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_alter1_myisam.result -> mysql-test/suite/parts/r/partition_alter1_myisam.result
mysql-test/suite/parts/r/partition_alter2_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_alter2_innodb.result -> mysql-test/suite/parts/r/partition_alter2_innodb.result
mysql-test/suite/parts/r/partition_alter2_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_alter2_myisam.result -> mysql-test/suite/parts/r/partition_alter2_myisam.result
mysql-test/suite/parts/r/partition_alter3_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_alter3_innodb.result -> mysql-test/suite/parts/r/partition_alter3_innodb.result
mysql-test/suite/parts/r/partition_alter3_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_alter3_myisam.result -> mysql-test/suite/parts/r/partition_alter3_myisam.result
mysql-test/suite/parts/r/partition_alter4_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_alter4_innodb.result -> mysql-test/suite/parts/r/partition_alter4_innodb.result
mysql-test/suite/parts/r/partition_alter4_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_alter4_myisam.result -> mysql-test/suite/parts/r/partition_alter4_myisam.result
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_basic_innodb.result -> mysql-test/suite/parts/r/partition_basic_innodb.result
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_basic_myisam.result -> mysql-test/suite/parts/r/partition_basic_myisam.result
mysql-test/suite/parts/r/partition_bit_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_bit_innodb.result -> mysql-test/suite/parts/r/partition_bit_innodb.result
mysql-test/suite/parts/r/partition_bit_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_bit_myisam.result -> mysql-test/suite/parts/r/partition_bit_myisam.result
mysql-test/suite/parts/r/partition_bit_ndb.result:
  Rename: mysql-test/suite/partitions/r/partition_bit_ndb.result -> mysql-test/suite/parts/r/partition_bit_ndb.result
mysql-test/suite/parts/r/partition_char_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_char_innodb.result -> mysql-test/suite/parts/r/partition_char_innodb.result
mysql-test/suite/parts/r/partition_char_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_char_myisam.result -> mysql-test/suite/parts/r/partition_char_myisam.result
mysql-test/suite/parts/r/partition_datetime_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_datetime_innodb.result -> mysql-test/suite/parts/r/partition_datetime_innodb.result
mysql-test/suite/parts/r/partition_datetime_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_datetime_myisam.result -> mysql-test/suite/parts/r/partition_datetime_myisam.result
mysql-test/suite/parts/r/partition_decimal_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_decimal_innodb.result -> mysql-test/suite/parts/r/partition_decimal_innodb.result
mysql-test/suite/parts/r/partition_decimal_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_decimal_myisam.result -> mysql-test/suite/parts/r/partition_decimal_myisam.result
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_engine_innodb.result -> mysql-test/suite/parts/r/partition_engine_innodb.result
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_engine_myisam.result -> mysql-test/suite/parts/r/partition_engine_myisam.result
mysql-test/suite/parts/r/partition_engine_ndb.result:
  Rename: mysql-test/suite/partitions/r/partition_engine_ndb.result -> mysql-test/suite/parts/r/partition_engine_ndb.result
mysql-test/suite/parts/r/partition_float_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_float_innodb.result -> mysql-test/suite/parts/r/partition_float_innodb.result
mysql-test/suite/parts/r/partition_float_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_float_myisam.result -> mysql-test/suite/parts/r/partition_float_myisam.result
mysql-test/suite/parts/r/partition_int_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_int_innodb.result -> mysql-test/suite/parts/r/partition_int_innodb.result
mysql-test/suite/parts/r/partition_int_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_int_myisam.result -> mysql-test/suite/parts/r/partition_int_myisam.result
mysql-test/suite/parts/r/partition_int_ndb.result:
  Rename: mysql-test/suite/partitions/r/partition_int_ndb.result -> mysql-test/suite/parts/r/partition_int_ndb.result
mysql-test/suite/parts/r/partition_special_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_special_innodb.result -> mysql-test/suite/parts/r/partition_special_innodb.result
mysql-test/suite/parts/r/partition_special_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_special_myisam.result -> mysql-test/suite/parts/r/partition_special_myisam.result
mysql-test/suite/parts/r/partition_syntax_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_syntax_innodb.result -> mysql-test/suite/parts/r/partition_syntax_innodb.result
mysql-test/suite/parts/r/partition_syntax_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_syntax_myisam.result -> mysql-test/suite/parts/r/partition_syntax_myisam.result
mysql-test/suite/parts/r/partition_syntax_ndb.result:
  Rename: mysql-test/suite/partitions/r/partition_syntax_ndb.result -> mysql-test/suite/parts/r/partition_syntax_ndb.result
mysql-test/suite/parts/r/partition_t55.out:
  Rename: mysql-test/suite/partitions/r/partition_t55.out -> mysql-test/suite/parts/r/partition_t55.out
mysql-test/suite/parts/r/partition_value_innodb.result:
  Rename: mysql-test/suite/partitions/r/partition_value_innodb.result -> mysql-test/suite/parts/r/partition_value_innodb.result
mysql-test/suite/parts/r/partition_value_myisam.result:
  Rename: mysql-test/suite/partitions/r/partition_value_myisam.result -> mysql-test/suite/parts/r/partition_value_myisam.result
mysql-test/suite/parts/r/partition_value_ndb.result:
  Rename: mysql-test/suite/partitions/r/partition_value_ndb.result -> mysql-test/suite/parts/r/partition_value_ndb.result
mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result:
  Rename: mysql-test/suite/partitions/r/rpl_ndb_dd_partitions.result -> mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result
mysql-test/suite/parts/t/disabled.def:
  Rename: mysql-test/suite/partitions/t/disabled.def -> mysql-test/suite/parts/t/disabled.def
mysql-test/suite/parts/t/ndb_blob_partition.test:
  Rename: mysql-test/suite/partitions/t/ndb_blob_partition.test -> mysql-test/suite/parts/t/ndb_blob_partition.test
mysql-test/suite/parts/t/ndb_dd_backuprestore.test:
  Rename: mysql-test/suite/partitions/t/ndb_dd_backuprestore.test -> mysql-test/suite/parts/t/ndb_dd_backuprestore.test
mysql-test/suite/parts/t/ndb_partition_error.test:
  Rename: mysql-test/suite/partitions/t/ndb_partition_error.test -> mysql-test/suite/parts/t/ndb_partition_error.test
mysql-test/suite/parts/t/ndb_partition_key.test:
  Rename: mysql-test/suite/partitions/t/ndb_partition_key.test -> mysql-test/suite/parts/t/ndb_partition_key.test
mysql-test/suite/parts/t/ndb_partition_list.test:
  Rename: mysql-test/suite/partitions/t/ndb_partition_list.test -> mysql-test/suite/parts/t/ndb_partition_list.test
mysql-test/suite/parts/t/ndb_partition_range.test:
  Rename: mysql-test/suite/partitions/t/ndb_partition_range.test -> mysql-test/suite/parts/t/ndb_partition_range.test
mysql-test/suite/parts/t/partition_sessions.test:
  Rename: mysql-test/suite/partitions/t/partition_sessions.test -> mysql-test/suite/parts/t/partition_sessions.test
mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test:
  Rename: mysql-test/suite/partitions/t/rpl_ndb_dd_partitions.test -> mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test
mysql-test/suite/parts/inc/partition.pre:
  Rename: mysql-test/suite/parts/include/partition.pre -> mysql-test/suite/parts/inc/partition.pre
mysql-test/suite/parts/inc/partition_20.inc:
  Rename: mysql-test/suite/parts/include/partition_20.inc -> mysql-test/suite/parts/inc/partition_20.inc
mysql-test/suite/parts/inc/partition_bigint.inc:
  Rename: mysql-test/suite/parts/include/partition_bigint.inc -> mysql-test/suite/parts/inc/partition_bigint.inc
mysql-test/suite/parts/inc/partition_binary.inc:
  Rename: mysql-test/suite/parts/include/partition_binary.inc -> mysql-test/suite/parts/inc/partition_binary.inc
mysql-test/suite/parts/inc/partition_bit.inc:
  Rename: mysql-test/suite/parts/include/partition_bit.inc -> mysql-test/suite/parts/inc/partition_bit.inc
mysql-test/suite/parts/inc/partition_blob.inc:
  Rename: mysql-test/suite/parts/include/partition_blob.inc -> mysql-test/suite/parts/inc/partition_blob.inc
mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc:
  Rename: mysql-test/suite/parts/include/partition_blocked_sql_funcs.inc -> mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc
mysql-test/suite/parts/inc/partition_char.inc:
  Rename: mysql-test/suite/parts/include/partition_char.inc -> mysql-test/suite/parts/inc/partition_char.inc
mysql-test/suite/parts/inc/partition_check_drop.inc:
  Rename: mysql-test/suite/parts/include/partition_check_drop.inc -> mysql-test/suite/parts/inc/partition_check_drop.inc
mysql-test/suite/parts/inc/partition_check_read.inc:
  Rename: mysql-test/suite/parts/include/partition_check_read.inc -> mysql-test/suite/parts/inc/partition_check_read.inc
mysql-test/suite/parts/inc/partition_check_read1.inc:
  Rename: mysql-test/suite/parts/include/partition_check_read1.inc -> mysql-test/suite/parts/inc/partition_check_read1.inc
mysql-test/suite/parts/inc/partition_check_read2.inc:
  Rename: mysql-test/suite/parts/include/partition_check_read2.inc -> mysql-test/suite/parts/inc/partition_check_read2.inc
mysql-test/suite/parts/inc/partition_cleanup.inc:
  Rename: mysql-test/suite/parts/include/partition_cleanup.inc -> mysql-test/suite/parts/inc/partition_cleanup.inc
mysql-test/suite/parts/inc/partition_date.inc:
  Rename: mysql-test/suite/parts/include/partition_date.inc -> mysql-test/suite/parts/inc/partition_date.inc
mysql-test/suite/parts/inc/partition_datetime.inc:
  Rename: mysql-test/suite/parts/include/partition_datetime.inc -> mysql-test/suite/parts/inc/partition_datetime.inc
mysql-test/suite/parts/inc/partition_decimal.inc:
  Rename: mysql-test/suite/parts/include/partition_decimal.inc -> mysql-test/suite/parts/inc/partition_decimal.inc
mysql-test/suite/parts/inc/partition_double.inc:
  Rename: mysql-test/suite/parts/include/partition_double.inc -> mysql-test/suite/parts/inc/partition_double.inc
mysql-test/suite/parts/inc/partition_enum.inc:
  Rename: mysql-test/suite/parts/include/partition_enum.inc -> mysql-test/suite/parts/inc/partition_enum.inc
mysql-test/suite/parts/inc/partition_float.inc:
  Rename: mysql-test/suite/parts/include/partition_float.inc -> mysql-test/suite/parts/inc/partition_float.inc
mysql-test/suite/parts/inc/partition_int.inc:
  Rename: mysql-test/suite/parts/include/partition_int.inc -> mysql-test/suite/parts/inc/partition_int.inc
mysql-test/suite/parts/inc/partition_key_16col.inc:
  Rename: mysql-test/suite/parts/include/partition_key_16col.inc -> mysql-test/suite/parts/inc/partition_key_16col.inc
mysql-test/suite/parts/inc/partition_key_32col.inc:
  Rename: mysql-test/suite/parts/include/partition_key_32col.inc -> mysql-test/suite/parts/inc/partition_key_32col.inc
mysql-test/suite/parts/inc/partition_key_4col.inc:
  Rename: mysql-test/suite/parts/include/partition_key_4col.inc -> mysql-test/suite/parts/inc/partition_key_4col.inc
mysql-test/suite/parts/inc/partition_key_8col.inc:
  Rename: mysql-test/suite/parts/include/partition_key_8col.inc -> mysql-test/suite/parts/inc/partition_key_8col.inc
mysql-test/suite/parts/inc/partition_layout_check1.inc:
  Rename: mysql-test/suite/parts/include/partition_layout_check1.inc -> mysql-test/suite/parts/inc/partition_layout_check1.inc
mysql-test/suite/parts/inc/partition_layout_check2.inc:
  Rename: mysql-test/suite/parts/include/partition_layout_check2.inc -> mysql-test/suite/parts/inc/partition_layout_check2.inc
mysql-test/suite/parts/inc/partition_mediumint.inc:
  Rename: mysql-test/suite/parts/include/partition_mediumint.inc -> mysql-test/suite/parts/inc/partition_mediumint.inc
mysql-test/suite/parts/inc/partition_set.inc:
  Rename: mysql-test/suite/parts/include/partition_set.inc -> mysql-test/suite/parts/inc/partition_set.inc
mysql-test/suite/parts/inc/partition_smallint.inc:
  Rename: mysql-test/suite/parts/include/partition_smallint.inc -> mysql-test/suite/parts/inc/partition_smallint.inc
mysql-test/suite/parts/inc/partition_text.inc:
  Rename: mysql-test/suite/parts/include/partition_text.inc -> mysql-test/suite/parts/inc/partition_text.inc
mysql-test/suite/parts/inc/partition_time.inc:
  Rename: mysql-test/suite/parts/include/partition_time.inc -> mysql-test/suite/parts/inc/partition_time.inc
mysql-test/suite/parts/inc/partition_timestamp.inc:
  Rename: mysql-test/suite/parts/include/partition_timestamp.inc -> mysql-test/suite/parts/inc/partition_timestamp.inc
mysql-test/suite/parts/inc/partition_tinyint.inc:
  Rename: mysql-test/suite/parts/include/partition_tinyint.inc -> mysql-test/suite/parts/inc/partition_tinyint.inc
mysql-test/suite/parts/inc/partition_trigg1.inc:
  Rename: mysql-test/suite/parts/include/partition_trigg1.inc -> mysql-test/suite/parts/inc/partition_trigg1.inc
mysql-test/suite/parts/inc/partition_trigg2.inc:
  Rename: mysql-test/suite/parts/include/partition_trigg2.inc -> mysql-test/suite/parts/inc/partition_trigg2.inc
mysql-test/suite/parts/inc/partition_trigg3.inc:
  Rename: mysql-test/suite/parts/include/partition_trigg3.inc -> mysql-test/suite/parts/inc/partition_trigg3.inc
mysql-test/suite/parts/inc/partition_value.inc:
  Rename: mysql-test/suite/parts/include/partition_value.inc -> mysql-test/suite/parts/inc/partition_value.inc
mysql-test/suite/parts/inc/partition_varbinary.inc:
  Rename: mysql-test/suite/parts/include/partition_varbinary.inc -> mysql-test/suite/parts/inc/partition_varbinary.inc
mysql-test/suite/parts/inc/partition_varchar.inc:
  Rename: mysql-test/suite/parts/include/partition_varchar.inc -> mysql-test/suite/parts/inc/partition_varchar.inc
mysql-test/suite/parts/inc/partition_year.inc:
  Rename: mysql-test/suite/parts/include/partition_year.inc -> mysql-test/suite/parts/inc/partition_year.inc
mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc:
  Rename: mysql-test/suite/parts/inc/partition_supported_sql_funcs_int_ch1.in -> mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc
mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc:
  Rename: mysql-test/suite/parts/inc/partition_supported_sql_funcs_int_date.in -> mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc
mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc:
  Rename: mysql-test/suite/parts/inc/partition_supported_sql_funcs_int_float.in -> mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc
mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc:
  Rename: mysql-test/suite/parts/inc/partition_supported_sql_funcs_int_int.in -> mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc
mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result:
  Rename: mysql-test/suite/parts/r/partition_blocked_sql_func_innodb.result -> mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result
mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result:
  Rename: mysql-test/suite/parts/r/partition_blocked_sql_func_myisam.result -> mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result
mysql-test/suite/parts/r/part_supported_sql_func_ndb.result:
  Rename: mysql-test/suite/parts/r/partition_supported_sql_func_ndb.result -> mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.cin -> mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc
2007-04-30 16:24:13 +02:00

811 lines
30 KiB
PHP

################################################################################
# include/partition_syntax.inc #
# #
# Purpose: #
# Tests around Create partitioned tables syntax #
# #
#------------------------------------------------------------------------------#
# Original Author: ML #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
# FIXME Implement testcases, where it is checked that all create and
# alter table statements
# - with missing mandatory parameters are rejected
# - with optional parameters are accepted
# - with wrong combinations of optional parameters are rejected
# - ............
--echo
--echo #========================================================================
--echo # 1. Any PRIMARY KEYs or UNIQUE INDEXes must contain the columns used
--echo # within the partitioning functions
--echo #========================================================================
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
--echo #------------------------------------------------------------------------
--echo # 1.1 column of partitioning function not included in PRIMARY KEY
--echo # PARTITION BY HASH/KEY/LIST/RANGE
--echo #------------------------------------------------------------------------
#----------- PARTITION BY HASH
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY HASH(f_int1) PARTITIONS 2;
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
#----------- PARTITION BY KEY
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY KEY(f_int1) PARTITIONS 2;
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
#----------- PARTITION BY LIST
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY LIST(f_int1)
(PARTITION part1 VALUES IN (1));
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY LIST(f_int1 + f_int2)
(PARTITION part1 VALUES IN (1));
#----------- PARTITION BY RANGE
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY RANGE(f_int1)
(PARTITION part1 VALUES LESS THAN (1));
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY RANGE(f_int1 + f_int2)
(PARTITION part1 VALUES LESS THAN (1));
#
--echo #------------------------------------------------------------------------
--echo # 1.2 column of partitioning function not included in UNIQUE INDEX
--echo # PARTITION BY HASH/KEY/LIST/RANGE
--echo # Variant a) Without additional PRIMARY KEY
--echo # Variant b) With correct additional PRIMARY KEY
--echo # Variant 1) one column in partitioning function
--echo # Variant 2) two columns in partitioning function
--echo #------------------------------------------------------------------------
# Note: If the CREATE TABLE statement contains no PRIMARY KEY but
# UNIQUE INDEXes the MySQL layer tells the storage to use
# the first UNIQUE INDEX as PRIMARY KEY.
let $unique_index= UNIQUE INDEX (f_int2);
#----------- PARTITION BY HASH
let $partition_scheme= PARTITION BY HASH(f_int1) PARTITIONS 2;
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
let $partition_scheme= PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#----------- PARTITION BY KEY
let $partition_scheme= PARTITION BY KEY(f_int1) PARTITIONS 2;
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
let $partition_scheme= PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#----------- PARTITION BY LIST
let $partition_scheme= PARTITION BY LIST(MOD(f_int1,3))
(PARTITION partN VALUES IN (NULL),
PARTITION part0 VALUES IN (0),
PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
let $partition_scheme= PARTITION BY LIST(MOD(f_int1 + f_int2,3))
(PARTITION partN VALUES IN (NULL),
PARTITION part0 VALUES IN (0),
PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#----------- PARTITION BY RANGE
let $partition_scheme= PARTITION BY RANGE(f_int1)
(PARTITION part1 VALUES LESS THAN (1),
PARTITION part2 VALUES LESS THAN (2147483646));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
let $partition_scheme= PARTITION BY RANGE(f_int1 + f_int2)
(PARTITION part1 VALUES LESS THAN (1),
PARTITION part2 VALUES LESS THAN (2147483646));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#
--echo #------------------------------------------------------------------------
--echo # 1.3 column of subpartitioning function not included in PRIMARY KEY
--echo # PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
--echo #------------------------------------------------------------------------
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY RANGE(f_int2) SUBPARTITION BY HASH(f_int1)
(PARTITION part1 VALUES LESS THAN (1)
(SUBPARTITION subpart1));
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY RANGE(f_int2) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (1)
(SUBPARTITION subpart1));
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY LIST(f_int2) SUBPARTITION BY HASH(f_int1)
(PARTITION part1 VALUES IN (1)
(SUBPARTITION subpart1));
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int2)
)
PARTITION BY LIST(f_int2) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES IN (1)
(SUBPARTITION subpart1));
#
--echo #------------------------------------------------------------------------
--echo # 1.4 column of subpartitioning function not included in UNIQUE INDEX
--echo # PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
--echo # Variant a) Without additional PRIMARY KEY
--echo # Variant b) With correct additional PRIMARY KEY
--echo #------------------------------------------------------------------------
let $partition_scheme= PARTITION BY RANGE(f_int2)
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
(PARTITION part1 VALUES LESS THAN (1),
PARTITION part2 VALUES LESS THAN (2147483646));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
let $partition_scheme= PARTITION BY RANGE(f_int2)
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
(PARTITION part1 VALUES LESS THAN (1),
PARTITION part2 VALUES LESS THAN (2147483646));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
let $partition_scheme= PARTITION BY LIST(MOD(f_int2,3))
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION partN VALUES IN (NULL),
PARTITION part0 VALUES IN (0),
PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
let $partition_scheme= PARTITION BY LIST(MOD(f_int2,3))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2
(PARTITION partN VALUES IN (NULL),
PARTITION part0 VALUES IN (0),
PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2));
--source suite/parts/inc/partition_syntax_2.inc
# --source include/partition_syntax_2.inc
--echo
--echo #========================================================================
--echo # 2 Some properties around subpartitioning
--echo #========================================================================
--echo #------------------------------------------------------------------------
--echo # 2.1 Subpartioned table without subpartitioning rule must be rejected
--echo #------------------------------------------------------------------------
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Bug#15961 Partitions: Creation of subpart. table without subpart. rule not rejected
--error ER_SUBPARTITION_ERROR
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11));
--echo #------------------------------------------------------------------------
--echo # 2.2 Every partition must have the same number of subpartitions.
--echo # This is a limitation of MySQL 5.1, which could be removed in
--echo # later releases.
--echo #------------------------------------------------------------------------
--error 1064
eval CREATE TABLE t1 (
$column_list,
PRIMARY KEY (f_int1)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(
PARTITION part1 VALUES LESS THAN (0)
(SUBPARTITION subpart1),
PARTITION part2 VALUES LESS THAN ($max_row_div4)
(SUBPARTITION subpart1, SUBPARTITION subpart2));
--echo
--echo #========================================================================
--echo # 3 VALUES clauses
--echo #========================================================================
--echo #------------------------------------------------------------------------
--echo # 3.1 The constants in VALUES IN clauses must differ
--echo #------------------------------------------------------------------------
--error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (-1),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (-1));
# constant followed by the same constant
--error ER_RANGE_NOT_INCREASING_ERROR
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT)
PARTITION BY RANGE(f1)
(PARTITION part1 VALUES LESS THAN (0),
PARTITION part2 VALUES LESS THAN (0),
PARTITION part3 VALUES LESS THAN (10000));
--echo #------------------------------------------------------------------------
--echo # 3.2 The constants in VALUES LESS must be in increasing order
--echo #------------------------------------------------------------------------
# constant followed somewhere by the smaller constant
--error ER_RANGE_NOT_INCREASING_ERROR
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT)
PARTITION BY RANGE(f1)
(PARTITION part1 VALUES LESS THAN (0),
PARTITION part2 VALUES LESS THAN (-1),
PARTITION part3 VALUES LESS THAN (10000));
--echo #------------------------------------------------------------------------
--echo # 3.3 LIST partitions must be defined with VALUES IN
--echo #------------------------------------------------------------------------
--error ER_PARTITION_WRONG_VALUES_ERROR
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES LESS THAN (-1),
PARTITION part2 VALUES LESS THAN (0),
PARTITION part3 VALUES LESS THAN (1000));
--echo #------------------------------------------------------------------------
--echo # 3.4 RANGE partitions must be defined with VALUES LESS THAN
--echo #------------------------------------------------------------------------
--error ER_PARTITION_WRONG_VALUES_ERROR
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES IN (-1),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1000));
--echo #------------------------------------------------------------------------
--echo # 3.5 Use of NULL in VALUES clauses
--echo #------------------------------------------------------------------------
--echo # 3.5.1 NULL in RANGE partitioning clause
--echo # 3.5.1.1 VALUE LESS THAN (NULL) is not allowed
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
--echo # 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
PARTITION part2 VALUES LESS THAN (1000));
--echo # 3.5.2 NULL in LIST partitioning clause
--echo # 3.5.2.1 VALUE IN (NULL)
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
--echo # 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
# Attention: It is intended that there is no partition with
# VALUES IN (0), because there was a time where NULL was treated as zero
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
PARTITION part3 VALUES IN (1));
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
--echo # 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0)
# Bug#15447: Partitions: NULL is treated as zero
# We would get a clash here if such a mapping would be done.
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
# FIXME Implement some non integer constant tests
--echo
--echo #========================================================================
--echo # 4. Check assigning the number of partitions and subpartitions
--echo # with and without named partitions/subpartitions
--echo #========================================================================
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo #------------------------------------------------------------------------
--echo # 4.1 (positive) without partition/subpartition number assignment
--echo #------------------------------------------------------------------------
--echo # 4.1.1 no partition number, no named partitions
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1);
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
--echo # 4.1.2 no partition number, named partitions
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part2);
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
# Attention: Several combinations are impossible
# If subpartitioning exists
# - partitioning algorithm must be RANGE or LIST
# This implies the assignment of named partitions.
# - subpartitioning algorithm must be HASH or KEY
--echo # 4.1.3 variations on no partition/subpartition number, named partitions,
--echo # different subpartitions are/are not named
#
# Partition name -- "properties"
# part1 -- first/non last
# part2 -- non first/non last
# part3 -- non first/ last
#
# Testpattern:
# named subpartitions in
# Partition part1 part2 part3
# N N N
# N N Y
# N Y N
# N Y Y
# Y N N
# Y N Y
# Y Y N
# Y Y Y
--disable_query_log
let $part01= CREATE TABLE t1 ( ;
let $part02= )
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1);
#
eval SET @aux = '(PARTITION part1 VALUES LESS THAN ($max_row_div2),';
let $part1_N= `SELECT @AUX`;
eval SET @aux = '(PARTITION part1 VALUES LESS THAN ($max_row_div2)
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ),';
let $part1_Y= `SELECT @AUX`;
#
eval SET @aux = 'PARTITION part2 VALUES LESS THAN ($max_row),';
let $part2_N= `SELECT @AUX`;
eval SET @aux = 'PARTITION part2 VALUES LESS THAN ($max_row)
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ),';
let $part2_Y= `SELECT @AUX`;
#
eval SET @aux = 'PARTITION part3 VALUES LESS THAN $MAX_VALUE)';
let $part3_N= `SELECT @AUX`;
eval SET @aux = 'PARTITION part3 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart31 , SUBPARTITION subpart32 ))';
let $part3_Y= `SELECT @AUX`;
--enable_query_log
eval $part01 $column_list $part02 $part1_N $part2_N $part3_N ;
DROP TABLE t1;
# Bug#15407 Partitions: crash if subpartition
--error 1064
eval $part01 $column_list $part02 $part1_N $part2_N $part3_Y ;
--error 1064
eval $part01 $column_list $part02 $part1_N $part2_Y $part3_N ;
--error 1064
eval $part01 $column_list $part02 $part1_N $part2_Y $part3_Y ;
--error 1064
eval $part01 $column_list $part02 $part1_Y $part2_N $part3_N ;
--error 1064
eval $part01 $column_list $part02 $part1_Y $part2_N $part3_Y ;
--error 1064
eval $part01 $column_list $part02 $part1_Y $part2_Y $part3_N ;
eval $part01 $column_list $part02 $part1_Y $part2_Y $part3_Y ;
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
--echo #------------------------------------------------------------------------
--echo # 4.2 partition/subpartition numbers good and bad values and notations
--echo #------------------------------------------------------------------------
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo # 4.2.1 partition/subpartition numbers INTEGER notation
# ML: "positive/negative" is my private judgement. It need no to correspond
# with the server response.
# (positive) number = 2
let $part_number= 2;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (positive) special case number = 1
let $part_number= 1;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) 0 is non sense
let $part_number= 0;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) -1 is non sense
let $part_number= -1;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) 1000000 is too huge
let $part_number= 1000000;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
--echo # 4.2.2 partition/subpartition numbers DECIMAL notation
# (positive) number = 2.0
let $part_number= 2.0;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) -2.0 is non sense
let $part_number= -2.0;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) case number = 0.0 is non sense
let $part_number= 0.0;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
if ($fixed_bug15890)
{
# Bug#15890 Partitions: Strange interpretation of partition number
# (negative) number = 1.6 is non sense
let $part_number= 1.6;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
}
# (negative) number is too huge
let $part_number= 999999999999999999999999999999.999999999999999999999999999999;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) number is nearly zero
let $part_number= 0.000000000000000000000000000001;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
--echo # 4.2.3 partition/subpartition numbers FLOAT notation
##### FLOAT notation
# (positive) number = 2.0E+0
let $part_number= 2.0E+0;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
if ($fixed_bug15890)
{
# Bug#15890 Partitions: Strange interpretation of partition number
# (positive) number = 0.2E+1
let $part_number= 0.2E+1;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
}
# (negative) -2.0E+0 is non sense
let $part_number= -2.0E+0;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
if ($fixed_bug15890)
{
# Bug#15890 Partitions: Strange interpretation of partition number
# (negative) 0.16E+1 is non sense
let $part_number= 0.16E+1;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
}
# (negative) 0.0E+300 is zero
let $part_number= 0.0E+300;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
if ($fixed_bug15890)
{
# Bug#15890 Partitions: Strange interpretation of partition number
# (negative) 1E+300 is too huge
let $part_number= 1E+300;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) 1E-300 is nearly zero
let $part_number= 1E-300;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
}
--echo # 4.2.4 partition/subpartition numbers STRING notation
##### STRING notation
# (negative?) case number = '2'
let $part_number= '2';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative?) case number = '2.0'
let $part_number= '2.0';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative?) case number = '0.2E+1'
let $part_number= '0.2E+1';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) Strings starts with digit, but 'A' follows
let $part_number= '2A';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) Strings starts with 'A', but digit follows
let $part_number= 'A2';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) empty string
let $part_number= '';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) string without any digits
let $part_number= 'GARBAGE';
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
--echo # 4.2.5 partition/subpartition numbers other notations
# (negative) Strings starts with digit, but 'A' follows
let $part_number= 2A;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) Strings starts with 'A', but digit follows
let $part_number= A2;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) string without any digits
let $part_number= GARBAGE;
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative?) double quotes
let $part_number= "2";
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) Strings starts with digit, but 'A' follows
let $part_number= "2A";
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) Strings starts with 'A', but digit follows
let $part_number= "A2";
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
# (negative) string without any digits
let $part_number= "GARBAGE";
--source suite/parts/inc/partition_syntax_1.inc
# --source include/partition_syntax_1.inc
--echo # 4.2.6 (negative) partition/subpartition numbers per @variables
SET @aux = 5;
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1) PARTITIONS @aux;
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
SUBPARTITIONS @aux = 5
(PARTITION part1 VALUES LESS THAN ($max_row_div2),
PARTITION part2 VALUES LESS THAN $MAX_VALUE);
--echo #------------------------------------------------------------------------
--echo # 4.3 Mixups of assigned partition/subpartition numbers and names
--echo #------------------------------------------------------------------------
--echo # 4.3.1 (positive) number of partition/subpartition
--echo # = number of named partition/subpartition
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1, PARTITION part2 ) ;
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1) PARTITIONS 2
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart21, SUBPARTITION subpart22)
);
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
DROP TABLE t1;
--echo # 4.3.2 (positive) number of partition/subpartition ,
--echo # 0 (= no) named partition/subpartition
--echo # already checked above
--echo # 4.3.3 (negative) number of partitions/subpartitions
--echo # > number of named partitions/subpartitions
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1 ) ;
# Wrong number of named subpartitions in first partition
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11 ),
PARTITION part2 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart21, SUBPARTITION subpart22)
);
# Wrong number of named subpartitions in non first/non last partition
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN (2000)
(SUBPARTITION subpart21 ),
PARTITION part3 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart31, SUBPARTITION subpart32)
);
# Wrong number of named subpartitions in last partition
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1) PARTITIONS 2
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart21 )
);
--echo # 4.3.4 (negative) number of partitions < number of named partitions
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1) PARTITIONS 1 ( PARTITION part1, PARTITION part2 ) ;
# Wrong number of named subpartitions in first partition
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 1
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart21, SUBPARTITION subpart22)
);
# Wrong number of named subpartitions in non first/non last partition
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 1
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN (2000)
(SUBPARTITION subpart21 ),
PARTITION part3 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart31, SUBPARTITION subpart32)
);
# Wrong number of named subpartitions in last partition
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 1
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart21, SUBPARTITION subpart22)
);
--echo
--echo #========================================================================
--echo # 5. Checks of logical partition/subpartition name
--echo # file name clashes during CREATE TABLE
--echo #========================================================================
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo #------------------------------------------------------------------------
--echo # 5.1 (negative) A partition/subpartition name used more than once
--echo #------------------------------------------------------------------------
--echo # 5.1.1 duplicate partition name
--error ER_SAME_NAME_PARTITION
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part1);
#
--echo # 5.1.2 duplicate subpartition name
# Bug#15408 Partitions: subpartition names are not unique
--error ER_SAME_NAME_PARTITION
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
SUBPARTITION BY HASH(f_int1)
( PARTITION part1 VALUES LESS THAN (1000)
(SUBPARTITION subpart11, SUBPARTITION subpart11)
);
# FIXME Implement testcases with filename problems
# existing file of other table --- partition/subpartition file name
# partition/subpartition file name --- file of the same table