mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 19:41:47 +01:00
bfed329e17
Bug #30316: Some "parts" tests fail because the server uses "--secure-file-priv" Bug #30341: Test suite "parts" needs to be adapted to the new rules disallowing many functio Bug #30408: Suite "parts" needs bug numbers updated Bug #30411: Suite "parts" needs bug numbers updated: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir Bug #30581: partition_value tests use disallowed CAST() function Included are some general fixes to allow the "parts" test suite to be run successfully. This includes disabling a few tests or parts of tests, cleaning up the test cases and their results, etc. Basically, these tests have not been run for some time, and had suffered some bit rot. The bugs were fixed as a single changeset, because in some ways they depend on each other. I couldn't be sure I'd updated all the error codes (for bugs 30408 and 30411) without also adapting to the new allowed functions rules (bug 30341), and vice versa. mysql-test/include/partition_layout.inc: Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc: Add ASCII(), ORD() and WEEKOFYEAR() as blocked functions (they depend too much on character set, etc.). Remove DATEDIFF() as a blocked function (it is implemented in terms of TO_DAYS() and the minus operator). mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc: Remove ASCII(), ORD() and WEEKOFYEAR(), which are not allowed functions. Remove uses of CAST() in partitioning functions - it is not allowed. Disable testing of FLOOR() and CEILING on non-integer fields, due to Bug 30577. Test MOD() with an integer field instead of floating point (it has a hybrid result type, like FLOOR() and CEILING(), but makes sense to use with an integer field). Add DATEDIFF() as an allowed function, because it is implemented in terms of TO_DAYS() and the minus operator. mysql-test/suite/parts/inc/partition_alter3.inc: Remove use of disallowed CAST() function in partitioning mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc: The blocked functions are actually blocked now, so expect errors. This is a result of the fix for bug 18198. mysql-test/suite/parts/inc/partition_date.inc: Remove uses of CAST() in partitioning functions - it is not allowed. mysql-test/suite/parts/inc/partition_datetime.inc: Remove uses of CAST() in partitioning functions - it is not allowed. mysql-test/suite/parts/inc/partition_decimal.inc: Remove uses of CAST() in partitioning functions - it is not allowed. Disable testing of FLOOR() and CEILING(), due to Bug 30577. mysql-test/suite/parts/inc/partition_directory.inc: Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file mysql-test/suite/parts/inc/partition_double.inc: Remove uses of CAST() in partitioning functions - it is not allowed. Disable testing of FLOOR() and CEILING(), due to Bug 30577. mysql-test/suite/parts/inc/partition_enum.inc: Remove use of CAST(), which is disallowed. Remove test which relies on CAST(). mysql-test/suite/parts/inc/partition_float.inc: Remove uses of CAST() in partitioning functions - it is not allowed. Disable testing of FLOOR() and CEILING(), due to Bug 30577. mysql-test/suite/parts/inc/partition_layout_check1.inc: Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file mysql-test/suite/parts/inc/partition_layout_check2.inc: Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file mysql-test/suite/parts/inc/partition_methods1.inc: Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file mysql-test/suite/parts/inc/partition_set.inc: Remove test which relies on CAST(), which is disallowed. mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc: Fix Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir Move data files into std_data/parts/*, so they can be used with LOAD DATA INFILE '../std_data_ln/parts/*' while --secure-file-priv is in force. mysql-test/suite/parts/inc/partition_syntax.inc: Remove use of CAST(), which is disallowed. mysql-test/suite/parts/inc/partition_time.inc: Remove use of CAST(), which is disallowed. mysql-test/suite/parts/inc/partition_timestamp.inc: Remove use of CAST(), which is disallowed. mysql-test/suite/parts/inc/partition_value.inc: Disable this entire test file, because it relies on using CAST() as a partitioning function, which is disallowed. See Bug 30581, "partition_value tests use disallowed CAST() function". mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result: Update test case results mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result: Update test case results mysql-test/suite/parts/r/part_supported_sql_func_innodb.result: Update test case results mysql-test/suite/parts/r/part_supported_sql_func_myisam.result: Update test case results mysql-test/suite/parts/r/partition_alter3_innodb.result: Update test case results mysql-test/suite/parts/r/partition_alter3_myisam.result: Update test case results mysql-test/suite/parts/r/partition_basic_innodb.result: Update test case results mysql-test/suite/parts/r/partition_basic_myisam.result: Update test case results mysql-test/suite/parts/r/partition_datetime_innodb.result: Update test case results mysql-test/suite/parts/r/partition_datetime_myisam.result: Update test case results mysql-test/suite/parts/r/partition_decimal_innodb.result: Update test case results mysql-test/suite/parts/r/partition_decimal_myisam.result: Update test case results mysql-test/suite/parts/r/partition_float_myisam.result: Update test case results mysql-test/suite/parts/r/partition_syntax_innodb.result: Update test case results mysql-test/suite/parts/r/partition_syntax_myisam.result: Update test case results mysql-test/suite/parts/t/disabled.def: Mark several more tests as disabled: partition_value_myisam, partition_value_innodb, part_supported_sql_func_ndb, rpl_ndb_dd_partitions, and partition_float_innodb mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc: Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc: Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc: Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc: Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc: Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc mysql-test/suite/parts/inc/partition_alter_1.inc: Correct expected error codes, which changed due to bug 29245. mysql-test/suite/parts/inc/partition_check.inc: Correct expected error codes, which changed due to bug 29245. mysql-test/suite/parts/inc/partition_syntax_1.inc: Correct expected error codes, which changed due to bug 29245.
335 lines
9.7 KiB
PHP
335 lines
9.7 KiB
PHP
################################################################################
|
|
# include/partition_methods1.inc #
|
|
# #
|
|
# Purpose: #
|
|
# Create and check partitioned tables #
|
|
# The partitioning function use the column f_int1 #
|
|
# #
|
|
# For all partitioning methods #
|
|
# PARTITION BY HASH/KEY/LIST/RANGE #
|
|
# PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... #
|
|
# do #
|
|
# 1. Create the partitioned table #
|
|
# 2 Insert the content of the table t0_template into t1 #
|
|
# 3. Execute include/partition_check.inc #
|
|
# 4. Drop the table t1 #
|
|
# done #
|
|
# #
|
|
# The parameter #
|
|
# $unique -- PRIMARY KEY or UNIQUE INDEXes to be created within the #
|
|
# CREATE TABLE STATEMENT #
|
|
# has to be set before sourcing this routine. #
|
|
# Example: #
|
|
# let $unique= , UNIQUE INDEX uidx1 (f_int1); #
|
|
# include/partition_method1s.inc #
|
|
# #
|
|
# Attention: The routine include/partition_methods2.inc is very similar #
|
|
# to this one. So if something has to be changed here it #
|
|
# might be necessary to do it also there #
|
|
# #
|
|
#------------------------------------------------------------------------------#
|
|
# Original Author: ML #
|
|
# Original Date: 2006-03-05 #
|
|
# Change Author: HH #
|
|
# Change Date: 2006-05-12 #
|
|
# Change: Introduced DATA/INDEX DIRECTORY #
|
|
################################################################################
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
let $partitioning= ;
|
|
#----------- PARTITION BY HASH
|
|
if ($with_partitioning)
|
|
{
|
|
let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2;
|
|
--disable_query_log
|
|
if ($with_directories)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY HASH(f_int1) PARTITIONS 2
|
|
(PARTITION p1
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION p2
|
|
$data_directory
|
|
$index_directory)';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY KEY
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY KEY(f_int1) PARTITIONS 5';
|
|
let $partitioning= `SELECT @aux`;
|
|
if ($with_directories)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY HASH(f_int1) PARTITIONS 5
|
|
(PARTITION p1
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION p2
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION p3
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION p4
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION p5
|
|
$data_directory
|
|
$index_directory)';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY LIST
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY LIST(MOD(f_int1,4))
|
|
(PARTITION part_3 VALUES IN (-3)
|
|
$data_directory $index_directory,
|
|
PARTITION part_2 VALUES IN (-2)
|
|
$data_directory $index_directory,
|
|
PARTITION part_1 VALUES IN (-1)
|
|
$data_directory $index_directory,
|
|
PARTITION part_N VALUES IN (NULL)
|
|
$data_directory $index_directory,
|
|
PARTITION part0 VALUES IN (0)
|
|
$data_directory $index_directory,
|
|
PARTITION part1 VALUES IN (1)
|
|
$data_directory $index_directory,
|
|
PARTITION part2 VALUES IN (2)
|
|
$data_directory $index_directory,
|
|
PARTITION part3 VALUES IN (3)
|
|
$data_directory $index_directory)';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY RANGE
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux = 'PARTITION BY RANGE(f_int1)
|
|
(PARTITION parta VALUES LESS THAN (0)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partb VALUES LESS THAN ($max_row_div4)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partc VALUES LESS THAN ($max_row_div2)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION parte VALUES LESS THAN ($max_row)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partf VALUES LESS THAN $MAX_VALUE
|
|
$data_directory
|
|
$index_directory)';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
|
|
(PARTITION parta VALUES LESS THAN (0)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partb VALUES LESS THAN ($max_row_div4)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partc VALUES LESS THAN ($max_row_div2)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION partd VALUES LESS THAN $MAX_VALUE
|
|
$data_directory
|
|
$index_directory)';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
|
|
(PARTITION part1 VALUES LESS THAN (0)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION subpart11, SUBPARTITION subpart12),
|
|
PARTITION part2 VALUES LESS THAN ($max_row_div4)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION subpart21, SUBPARTITION subpart22),
|
|
PARTITION part3 VALUES LESS THAN ($max_row_div2)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION subpart31, SUBPARTITION subpart32),
|
|
PARTITION part4 VALUES LESS THAN $MAX_VALUE
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
|
|
(PARTITION part1 VALUES IN (0)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION sp11
|
|
$data_directory
|
|
$index_directory,
|
|
SUBPARTITION sp12
|
|
$data_directory
|
|
$index_directory),
|
|
PARTITION part2 VALUES IN (1)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION sp21
|
|
$data_directory
|
|
$index_directory,
|
|
SUBPARTITION sp22
|
|
$data_directory
|
|
$index_directory),
|
|
PARTITION part3 VALUES IN (2)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION sp31,
|
|
SUBPARTITION sp32),
|
|
PARTITION part4 VALUES IN (NULL)
|
|
$data_directory
|
|
$index_directory
|
|
(SUBPARTITION sp41
|
|
$data_directory
|
|
$index_directory,
|
|
SUBPARTITION sp42
|
|
$data_directory
|
|
$index_directory))';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
|
|
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
|
|
--disable_query_log
|
|
if ($with_partitioning)
|
|
{
|
|
eval SET @aux =
|
|
'PARTITION BY LIST(ABS(MOD(f_int1,2)))
|
|
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no
|
|
(PARTITION part1 VALUES IN (0)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION part2 VALUES IN (1)
|
|
$data_directory
|
|
$index_directory,
|
|
PARTITION part3 VALUES IN (NULL)
|
|
$data_directory
|
|
$index_directory)';
|
|
let $partitioning= `SELECT @aux`;
|
|
}
|
|
eval CREATE TABLE t1 (
|
|
$column_list
|
|
$unique
|
|
)
|
|
$partitioning;
|
|
--enable_query_log
|
|
eval $insert_all;
|
|
--source suite/parts/inc/partition_check.inc
|
|
# --source include/partition_check.inc
|
|
DROP TABLE t1;
|
|
--source suite/parts/inc/partition_check_drop.inc
|
|
let $with_directories= FALSE;
|