mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
eca5c2c67f
MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
89 lines
3.5 KiB
Text
89 lines
3.5 KiB
Text
# Partitioning test that require debug features and InnoDB
|
|
# including crashing tests.
|
|
|
|
--source include/have_debug.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_partition.inc
|
|
# Don't test this under valgrind, memory leaks will occur. Also SIGKILL may
|
|
# not get trough and the test will hang.
|
|
--source include/not_valgrind.inc
|
|
# Crash tests don't work with embedded
|
|
--source include/not_embedded.inc
|
|
|
|
--let $DATADIR= `SELECT @@datadir;`
|
|
|
|
# Waiting for wl#6723
|
|
if (0)
|
|
{
|
|
--echo #
|
|
--echo # Bug#12696518/Bug#11766879/60106:DIFF BETWEEN # OF INDEXES IN MYSQL
|
|
--echo # VS INNODB, PARTITONING, ON INDEX CREATE
|
|
--echo #
|
|
CREATE TABLE t1
|
|
(a INT PRIMARY KEY,
|
|
b VARCHAR(64))
|
|
ENGINE = InnoDB
|
|
PARTITION BY HASH (a) PARTITIONS 3;
|
|
INSERT INTO t1 VALUES (0, 'first row'), (1, 'second row'), (2, 'Third row');
|
|
INSERT INTO t1 VALUES (3, 'row id 3'), (4, '4 row'), (5, 'row5');
|
|
INSERT INTO t1 VALUES (6, 'X 6 row'), (7, 'Seventh row'), (8, 'Last row');
|
|
|
|
ALTER TABLE t1 ADD INDEX new_b_index (b);
|
|
ALTER TABLE t1 DROP INDEX new_b_index;
|
|
|
|
SET @saved_dbug=@@debug_dbug;
|
|
SET SESSION debug_dbug = "+d,ha_partition_fail_final_add_index";
|
|
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
|
ALTER TABLE t1 ADD INDEX (b);
|
|
SHOW CREATE TABLE t1;
|
|
--sorted_result
|
|
SELECT * FROM t1;
|
|
|
|
FLUSH TABLES;
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
|
CREATE INDEX new_index ON t1 (b);
|
|
SHOW CREATE TABLE t1;
|
|
--sorted_result
|
|
SELECT * FROM t1;
|
|
|
|
SET SESSION debug_dbug = @saved_dbug;
|
|
SHOW CREATE TABLE t1;
|
|
DROP TABLE t1;
|
|
}
|
|
|
|
# Checking with #innodb what this is...
|
|
call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was");
|
|
# If there is a crash or failure between the ddl_log is written and the
|
|
# operation is completed, mysql will try to drop a not yet created partition
|
|
call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
|
|
call mtr.add_suppression("InnoDB: Warning: MySQL is trying to drop table ");
|
|
|
|
|
|
let $engine= 'InnoDB';
|
|
|
|
--echo # Test crash and failure recovery in fast_alter_partition_table.
|
|
--source suite/parts/inc/partition_mgm_crash.inc
|
|
|
|
--echo #
|
|
--echo # WL#4445: EXCHANGE PARTITION WITH TABLE
|
|
--echo # Verify ddl_log and InnoDB in case of crashing.
|
|
# Investigating if this warning is OK when crash testing.
|
|
call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was ");
|
|
#
|
|
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
|
|
call mtr.add_suppression("table .* does not exist in the InnoDB internal");
|
|
|
|
let $create_statement= CREATE TABLE t1 (a INT, b VARCHAR(64))
|
|
ENGINE = InnoDB
|
|
PARTITION BY RANGE (a)
|
|
(PARTITION p0 VALUES LESS THAN (10),
|
|
PARTITION p1 VALUES LESS THAN MAXVALUE);
|
|
let $insert_statement= INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
|
|
|
|
let $create_statement2= CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
|
|
let $insert_statement2= INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
|
|
let $crash_statement= ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
|
|
--source suite/parts/inc/partition_crash_exchange.inc
|
|
let $fail_statement= $crash_statement;
|
|
--source suite/parts/inc/partition_fail_exchange.inc
|