diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/mariabackup/xb_partition.test | |
parent | Initial commit. (diff) | |
download | mariadb-upstream.tar.xz mariadb-upstream.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/mariabackup/xb_partition.test')
-rw-r--r-- | mysql-test/suite/mariabackup/xb_partition.test | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/mysql-test/suite/mariabackup/xb_partition.test b/mysql-test/suite/mariabackup/xb_partition.test new file mode 100644 index 00000000..1c8eeaa1 --- /dev/null +++ b/mysql-test/suite/mariabackup/xb_partition.test @@ -0,0 +1,88 @@ +#--source include/innodb_page_size.inc +--source include/have_partition.inc +--source include/innodb_undo_tablespaces.inc + +CREATE TABLE t1(a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (3); + +CREATE TABLE t2(a INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (4), (5), (6); + +CREATE TABLE p ( + a int +) ENGINE=InnoDB +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN (200), + PARTITION p2 VALUES LESS THAN (300), + PARTITION p3 VALUES LESS THAN (400)); + +INSERT INTO p VALUES (1), (101), (201), (301); + +CREATE TABLE isam_t1(a INT) ENGINE=MyISAM; +INSERT INTO isam_t1 VALUES (1), (2), (3); + +CREATE TABLE isam_t2(a INT) ENGINE=MyISAM; +INSERT INTO isam_t2 VALUES (4), (5), (6); + +CREATE TABLE isam_p ( + a int +) ENGINE=MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN (200), + PARTITION p2 VALUES LESS THAN (300), + PARTITION p3 VALUES LESS THAN (400)); + +INSERT INTO isam_p VALUES (1), (101), (201), (301); + +let $targetdir=$MYSQLTEST_VARDIR/tmp; + +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir/full; +--enable_result_log + +DROP TABLE t1; +DROP TABLE t2; +CREATE TABLE t2(a INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (40), (50), (60); + +ALTER TABLE p DROP PARTITION p0; +ALTER TABLE p DROP PARTITION p1; +ALTER TABLE p ADD PARTITION (PARTITION p4 VALUES LESS THAN (500)); +ALTER TABLE p ADD PARTITION (PARTITION p5 VALUES LESS THAN (600)); + +INSERT INTO p VALUES (401), (501); + + +DROP TABLE isam_t1; +DROP TABLE isam_t2; +CREATE TABLE isam_t2(a INT) ENGINE=MyISAM; + +INSERT INTO isam_t2 VALUES (40), (50), (60); + +ALTER TABLE isam_p DROP PARTITION p0; +ALTER TABLE isam_p DROP PARTITION p1; +ALTER TABLE isam_p ADD PARTITION (PARTITION p4 VALUES LESS THAN (500)); +ALTER TABLE isam_p ADD PARTITION (PARTITION p5 VALUES LESS THAN (600)); + +INSERT INTO isam_p VALUES (401), (501); + +--disable_result_log +exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --incremental --no-timestamp --incremental-basedir=$targetdir/full $targetdir/inc; +exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log $targetdir/full; +exec $INNOBACKUPEX --defaults-file=$MYSQLTEST_VARDIR/my.cnf --apply-log --incremental-dir=$targetdir/inc $targetdir/full; + +let $targetdir=$targetdir/full; +-- source include/restart_and_restore.inc +--enable_result_log + +SELECT * from p; +SELECT * from isam_p; + +DROP TABLE isam_p; +DROP TABLE isam_t2; +DROP TABLE p; +DROP TABLE t2; +rmdir $MYSQLTEST_VARDIR/tmp/full; +rmdir $MYSQLTEST_VARDIR/tmp/inc; |