Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-18855 Mariabackup should fetch innodb_compression_level from run…
…ning server - Fetch innodb_compression_level from the running server.Add the value of innodb_compression_level in backup-my.cnf file during backup phase. So that prepare can use the innodb_compression_level variable from backup-my.cnf
- Loading branch information
1 parent
e3adf96
commit d038806
Showing
4 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| set global innodb_compression_level = 3; | ||
| CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1; | ||
| INSERT INTO t1 VALUES(1, 'mariadb'); | ||
| # xtrabackup backup | ||
| # xtrabackup prepare | ||
| FOUND /innodb_compression_level=3/ in backup-my.cnf | ||
| DELETE FROM t1; | ||
| ALTER TABLE t1 DISCARD TABLESPACE; | ||
| ALTER TABLE t1 IMPORT TABLESPACE; | ||
| SELECT * FROM t1; | ||
| c1 b | ||
| 1 mariadb | ||
| DROP TABLE t1; | ||
| set global innodb_compression_level = default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #--source include/innodb_page_size.inc | ||
|
|
||
| set global innodb_compression_level = 3; | ||
| CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1; | ||
| INSERT INTO t1 VALUES(1, 'mariadb'); | ||
|
|
||
| echo # xtrabackup backup; | ||
| let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; | ||
|
|
||
| --disable_result_log | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; | ||
| echo # xtrabackup prepare; | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.1 --prepare --export --target-dir=$targetdir; | ||
| --enable_result_log | ||
|
|
||
| --let SEARCH_PATTERN=innodb_compression_level=3 | ||
| --let SEARCH_FILE=$targetdir/backup-my.cnf | ||
| --source include/search_pattern_in_file.inc | ||
|
|
||
| DELETE FROM t1; | ||
| ALTER TABLE t1 DISCARD TABLESPACE; | ||
| let $MYSQLD_DATADIR= `select @@datadir`; | ||
| copy_file $targetdir/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd; | ||
| copy_file $targetdir/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg; | ||
| ALTER TABLE t1 IMPORT TABLESPACE; | ||
|
|
||
| SELECT * FROM t1; | ||
|
|
||
| DROP TABLE t1; | ||
| set global innodb_compression_level = default; | ||
| rmdir $targetdir; |