2007-02-06 13:35:54 +01:00
|
|
|
################################################################################
|
2007-11-20 16:04:07 +01:00
|
|
|
# inc/partition_alter3.inc #
|
2007-02-06 13:35:54 +01:00
|
|
|
# #
|
|
|
|
# Purpose: #
|
|
|
|
# Tests for partition management commands for HASH and KEY partitioning #
|
|
|
|
# #
|
|
|
|
#------------------------------------------------------------------------------#
|
2007-11-20 16:04:07 +01:00
|
|
|
# Original Author: mleich #
|
2007-02-06 13:35:54 +01:00
|
|
|
# Original Date: 2006-04-11 #
|
|
|
|
# Change Author: #
|
|
|
|
# Change Date: #
|
|
|
|
# Change: #
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo #========================================================================
|
|
|
|
--echo # 1. Partition management commands on HASH partitioned table
|
|
|
|
--echo # column in partitioning function is of type DATE
|
|
|
|
--echo #========================================================================
|
|
|
|
# 1. Create the table
|
|
|
|
--disable_warnings
|
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
--enable_warnings
|
|
|
|
eval CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30));
|
|
|
|
# 2. Fill the table t1 with records
|
|
|
|
INSERT INTO t1 (f_date, f_varchar)
|
|
|
|
SELECT CONCAT(CAST((f_int1 + 999) AS CHAR),'-02-10'), CAST(f_char1 AS CHAR)
|
|
|
|
FROM t0_template
|
|
|
|
WHERE f_int1 + 999 BETWEEN 1000 AND 9999;
|
|
|
|
# 3. Calculate the number of inserted records.
|
|
|
|
SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1)
|
|
|
|
INTO @exp_row_count;
|
|
|
|
# DEBUG SELECT @exp_row_count;
|
|
|
|
# 4. Print the layout, check Readability
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 1.1 Increase number of PARTITIONS
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 1.1.1 ADD PARTITION to not partitioned table --> must fail
|
|
|
|
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
|
|
|
|
#
|
|
|
|
--echo # 1.1.2 Assign HASH partitioning
|
Fixes for the following bugs:
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.
2007-08-27 14:08:32 -06:00
|
|
|
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 1.1.3 Assign other HASH partitioning to already partitioned table
|
|
|
|
--echo # + test and switch back + test
|
Fixes for the following bugs:
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.
2007-08-27 14:08:32 -06:00
|
|
|
ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
Fixes for the following bugs:
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.
2007-08-27 14:08:32 -06:00
|
|
|
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 1.1.4 Add PARTITIONS not fitting to HASH --> must fail
|
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part1 VALUES IN (0));
|
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (0));
|
|
|
|
#
|
|
|
|
--echo # 1.1.5 Add two named partitions + test
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 1.1.6 Add two named partitions, name clash --> must fail
|
|
|
|
--error ER_SAME_NAME_PARTITION
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
|
|
|
|
#
|
|
|
|
--echo # 1.1.7 Add one named partition + test
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 1.1.8 Add four not named partitions + test
|
|
|
|
ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 1.2 Decrease number of PARTITIONS
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 1.2.1 DROP PARTITION is not supported for HASH --> must fail
|
|
|
|
--error ER_ONLY_ON_RANGE_LIST_PARTITION
|
|
|
|
ALTER TABLE t1 DROP PARTITION part1;
|
|
|
|
#
|
|
|
|
--echo # 1.2.2 COALESCE PARTITION partitionname is not supported
|
2007-11-20 16:04:07 +01:00
|
|
|
--error ER_PARSE_ERROR
|
2007-02-06 13:35:54 +01:00
|
|
|
ALTER TABLE t1 COALESCE PARTITION part1;
|
|
|
|
#
|
|
|
|
--echo # 1.2.3 Decrease by 0 is non sense --> must fail
|
|
|
|
--error ER_COALESCE_PARTITION_NO_PARTITION
|
|
|
|
ALTER TABLE t1 COALESCE PARTITION 0;
|
|
|
|
#
|
|
|
|
--echo # 1.2.4 COALESCE one partition + test loop
|
|
|
|
let $loop= 7;
|
|
|
|
while ($loop)
|
|
|
|
{
|
|
|
|
ALTER TABLE t1 COALESCE PARTITION 1;
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
dec $loop;
|
|
|
|
}
|
|
|
|
--echo # 1.2.5 COALESCE of last partition --> must fail
|
|
|
|
--error ER_DROP_LAST_PARTITION
|
|
|
|
ALTER TABLE t1 COALESCE PARTITION 1;
|
|
|
|
#
|
|
|
|
--echo # 1.2.6 Remove partitioning
|
|
|
|
ALTER TABLE t1 REMOVE PARTITIONING;
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read1.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 1.2.7 Remove partitioning from not partitioned table --> ????
|
|
|
|
ALTER TABLE t1 REMOVE PARTITIONING;
|
|
|
|
DROP TABLE t1;
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_drop.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo #========================================================================
|
|
|
|
--echo # 2. Partition management commands on KEY partitioned table
|
|
|
|
--echo #========================================================================
|
|
|
|
# 1. Create the table
|
|
|
|
--disable_warnings
|
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
--enable_warnings
|
|
|
|
eval CREATE TABLE t1 (
|
|
|
|
$column_list
|
|
|
|
);
|
|
|
|
# 2. Fill the table t1 with some records
|
|
|
|
eval $insert_all;
|
|
|
|
# 4. Print the layout, check Readability
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 2.1 Increase number of PARTITIONS
|
|
|
|
--echo # Some negative testcases are omitted (already checked with HASH).
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 2.1.1 Assign KEY partitioning
|
|
|
|
ALTER TABLE t1 PARTITION BY KEY(f_int1);
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 2.1.2 Add PARTITIONS not fitting to KEY --> must fail
|
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part1 VALUES IN (0));
|
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (0));
|
|
|
|
#
|
|
|
|
--echo # 2.1.3 Add two named partitions + test
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 2.1.4 Add one named partition + test
|
|
|
|
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 2.1.5 Add four not named partitions + test
|
|
|
|
ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 2.2 Decrease number of PARTITIONS
|
|
|
|
--echo # Some negative testcases are omitted (already checked with HASH).
|
|
|
|
--echo #------------------------------------------------------------------------
|
|
|
|
--echo # 2.2.1 DROP PARTITION is not supported for KEY --> must fail
|
|
|
|
--error ER_ONLY_ON_RANGE_LIST_PARTITION
|
|
|
|
ALTER TABLE t1 DROP PARTITION part1;
|
|
|
|
#
|
|
|
|
--echo # 2.2.4 COALESCE one partition + test loop
|
|
|
|
let $loop= 7;
|
|
|
|
while ($loop)
|
|
|
|
{
|
|
|
|
ALTER TABLE t1 COALESCE PARTITION 1;
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
dec $loop;
|
|
|
|
}
|
|
|
|
--echo # 2.2.5 COALESCE of last partition --> must fail
|
|
|
|
--error ER_DROP_LAST_PARTITION
|
|
|
|
ALTER TABLE t1 COALESCE PARTITION 1;
|
|
|
|
#
|
|
|
|
--echo # 2.2.6 Remove partitioning
|
|
|
|
ALTER TABLE t1 REMOVE PARTITIONING;
|
2007-11-20 16:04:07 +01:00
|
|
|
--source suite/parts/inc/partition_layout.inc
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_read2.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
#
|
|
|
|
--echo # 2.2.7 Remove partitioning from not partitioned table --> ????
|
|
|
|
ALTER TABLE t1 REMOVE PARTITIONING;
|
|
|
|
DROP TABLE t1;
|
2007-04-30 16:24:13 +02:00
|
|
|
--source suite/parts/inc/partition_check_drop.inc
|
2007-02-06 13:35:54 +01:00
|
|
|
|