Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ca24f35b
Commit
ca24f35b
authored
Apr 18, 2017
by
Vladislav Vaintroub
Committed by
Sergei Golubchik
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9566 MariaBackup test suite
parent
1991411f
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
809 additions
and
0 deletions
+809
-0
mysql-test/suite/mariabackup/bug1509812-master.opt
mysql-test/suite/mariabackup/bug1509812-master.opt
+1
-0
mysql-test/suite/mariabackup/filekeys-data.enc
mysql-test/suite/mariabackup/filekeys-data.enc
+0
-0
mysql-test/suite/mariabackup/filekeys-data.key
mysql-test/suite/mariabackup/filekeys-data.key
+2
-0
mysql-test/suite/mariabackup/full_backup.result
mysql-test/suite/mariabackup/full_backup.result
+13
-0
mysql-test/suite/mariabackup/full_backup.test
mysql-test/suite/mariabackup/full_backup.test
+23
-0
mysql-test/suite/mariabackup/include/have_file_key_management.inc
...st/suite/mariabackup/include/have_file_key_management.inc
+4
-0
mysql-test/suite/mariabackup/include/restart_and_restore.inc
mysql-test/suite/mariabackup/include/restart_and_restore.inc
+15
-0
mysql-test/suite/mariabackup/incremental_backup.result
mysql-test/suite/mariabackup/incremental_backup.result
+20
-0
mysql-test/suite/mariabackup/incremental_backup.test
mysql-test/suite/mariabackup/incremental_backup.test
+35
-0
mysql-test/suite/mariabackup/incremental_encrypted.opt
mysql-test/suite/mariabackup/incremental_encrypted.opt
+3
-0
mysql-test/suite/mariabackup/incremental_encrypted.result
mysql-test/suite/mariabackup/incremental_encrypted.result
+20
-0
mysql-test/suite/mariabackup/incremental_encrypted.test
mysql-test/suite/mariabackup/incremental_encrypted.test
+45
-0
mysql-test/suite/mariabackup/partial.result
mysql-test/suite/mariabackup/partial.result
+13
-0
mysql-test/suite/mariabackup/partial.test
mysql-test/suite/mariabackup/partial.test
+31
-0
mysql-test/suite/mariabackup/small_ibd.result
mysql-test/suite/mariabackup/small_ibd.result
+1
-0
mysql-test/suite/mariabackup/small_ibd.test
mysql-test/suite/mariabackup/small_ibd.test
+18
-0
mysql-test/suite/mariabackup/suite.opt
mysql-test/suite/mariabackup/suite.opt
+1
-0
mysql-test/suite/mariabackup/suite.pm
mysql-test/suite/mariabackup/suite.pm
+38
-0
mysql-test/suite/mariabackup/tar.result
mysql-test/suite/mariabackup/tar.result
+12
-0
mysql-test/suite/mariabackup/tar.test
mysql-test/suite/mariabackup/tar.test
+30
-0
mysql-test/suite/mariabackup/xb_aws_key_management.opt
mysql-test/suite/mariabackup/xb_aws_key_management.opt
+3
-0
mysql-test/suite/mariabackup/xb_aws_key_management.result
mysql-test/suite/mariabackup/xb_aws_key_management.result
+11
-0
mysql-test/suite/mariabackup/xb_aws_key_management.test
mysql-test/suite/mariabackup/xb_aws_key_management.test
+22
-0
mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
+9
-0
mysql-test/suite/mariabackup/xb_compressed_encrypted.result
mysql-test/suite/mariabackup/xb_compressed_encrypted.result
+25
-0
mysql-test/suite/mariabackup/xb_compressed_encrypted.test
mysql-test/suite/mariabackup/xb_compressed_encrypted.test
+35
-0
mysql-test/suite/mariabackup/xb_file_key_management.opt
mysql-test/suite/mariabackup/xb_file_key_management.opt
+6
-0
mysql-test/suite/mariabackup/xb_file_key_management.result
mysql-test/suite/mariabackup/xb_file_key_management.result
+17
-0
mysql-test/suite/mariabackup/xb_file_key_management.test
mysql-test/suite/mariabackup/xb_file_key_management.test
+40
-0
mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
+8
-0
mysql-test/suite/mariabackup/xb_fulltext_encrypted.result
mysql-test/suite/mariabackup/xb_fulltext_encrypted.result
+14
-0
mysql-test/suite/mariabackup/xb_fulltext_encrypted.test
mysql-test/suite/mariabackup/xb_fulltext_encrypted.test
+23
-0
mysql-test/suite/mariabackup/xb_history.result
mysql-test/suite/mariabackup/xb_history.result
+5
-0
mysql-test/suite/mariabackup/xb_history.test
mysql-test/suite/mariabackup/xb_history.test
+8
-0
mysql-test/suite/mariabackup/xb_page_compress.result
mysql-test/suite/mariabackup/xb_page_compress.result
+28
-0
mysql-test/suite/mariabackup/xb_page_compress.test
mysql-test/suite/mariabackup/xb_page_compress.test
+44
-0
mysql-test/suite/mariabackup/xb_partition.result
mysql-test/suite/mariabackup/xb_partition.result
+64
-0
mysql-test/suite/mariabackup/xb_partition.test
mysql-test/suite/mariabackup/xb_partition.test
+87
-0
mysql-test/suite/mariabackup/xbstream.result
mysql-test/suite/mariabackup/xbstream.result
+13
-0
mysql-test/suite/mariabackup/xbstream.test
mysql-test/suite/mariabackup/xbstream.test
+22
-0
No files found.
mysql-test/suite/mariabackup/bug1509812-master.opt
0 → 100644
View file @
ca24f35b
--loose-skip-log-bin
\ No newline at end of file
mysql-test/suite/mariabackup/filekeys-data.enc
0 → 100644
View file @
ca24f35b
File added
mysql-test/suite/mariabackup/filekeys-data.key
0 → 100644
View file @
ca24f35b
secret
mysql-test/suite/mariabackup/full_backup.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup
INSERT INTO t VALUES(2);
# xtrabackup prepare
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * FROM t;
i
1
DROP TABLE t;
mysql-test/suite/mariabackup/full_backup.test
0 → 100644
View file @
ca24f35b
CREATE
TABLE
t
(
i
INT
)
ENGINE
INNODB
;
INSERT
INTO
t
VALUES
(
1
);
echo
# xtrabackup backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$targetdir
;
--
enable_result_log
INSERT
INTO
t
VALUES
(
2
);
echo
# xtrabackup prepare;
--
disable_result_log
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$targetdir
;
exec
$XTRABACKUP
--
defaults
-
file
=
$targetdir
/
backup
-
my
.
cnf
--
stats
--
datadir
=
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
SELECT
*
FROM
t
;
DROP
TABLE
t
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/include/have_file_key_management.inc
0 → 100644
View file @
ca24f35b
if
(
`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'file_key_management' AND PLUGIN_STATUS='ACTIVE'`
)
{
--
skip
Test
requires
file_key_management
plugin
}
mysql-test/suite/mariabackup/include/restart_and_restore.inc
0 → 100644
View file @
ca24f35b
let
$_server_id
=
`SELECT @@server_id`
;
let
$_datadir
=
`SELECT @@datadir`
;
let
$_expect_file_name
=
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
$_server_id
.
expect
;
exec
echo
"wait"
>
$_expect_file_name
;
echo
# shutdown server;
shutdown_server
;
echo
# remove datadir;
rmdir
$_datadir
;
echo
# xtrabackup move back;
exec
$XTRABACKUP
--
copy
-
back
--
datadir
=
$_datadir
--
target
-
dir
=
$targetdir
--
parallel
=
2
;
echo
# restart server;
exec
echo
"restart"
>
$_expect_file_name
;
enable_reconnect
;
source
include
/
wait_until_connected_again
.
inc
;
disable_reconnect
;
mysql-test/suite/mariabackup/incremental_backup.result
0 → 100644
View file @
ca24f35b
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# Create full backup , modify table, then create incremental/differential backup
INSERT INTO t VALUES(2);
SELECT * FROM t;
i
1
2
# Prepare full backup, apply incremental one
# Restore and check results
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * FROM t;
i
1
2
DROP TABLE t;
mysql-test/suite/mariabackup/incremental_backup.test
0 → 100644
View file @
ca24f35b
call
mtr
.
add_suppression
(
"InnoDB: New log files created"
);
let
$basedir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
let
$incremental_dir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup_inc1
;
CREATE
TABLE
t
(
i
INT
)
ENGINE
INNODB
;
INSERT
INTO
t
VALUES
(
1
);
echo
# Create full backup , modify table, then create incremental/differential backup;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$basedir
;
--
enable_result_log
INSERT
INTO
t
VALUES
(
2
);
SELECT
*
FROM
t
;
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$incremental_dir
--
incremental
-
basedir
=
$basedir
;
--
disable_result_log
echo
# Prepare full backup, apply incremental one;
exec
$XTRABACKUP
--
prepare
--
apply
-
log
-
only
--
target
-
dir
=
$basedir
;
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$basedir
--
incremental
-
dir
=
$incremental_dir
;
echo
# Restore and check results;
let
$targetdir
=
$basedir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
SELECT
*
FROM
t
;
DROP
TABLE
t
;
# Cleanup
rmdir
$basedir
;
rmdir
$incremental_dir
;
mysql-test/suite/mariabackup/incremental_encrypted.opt
0 → 100644
View file @
ca24f35b
--innodb-tablespaces-encryption
--plugin-load-add=$DEBUG_KEY_MANAGEMENT_SO
--loose-debug_key_management_version=2
mysql-test/suite/mariabackup/incremental_encrypted.result
0 → 100644
View file @
ca24f35b
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t(i INT) ENGINE INNODB ENCRYPTED=YES;
INSERT INTO t VALUES(1);
# Create full backup , modify table, then create incremental/differential backup
INSERT INTO t VALUES(2);
SELECT * FROM t;
i
1
2
# Prepare full backup, apply incremental one
# Restore and check results
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * FROM t;
i
1
2
DROP TABLE t;
mysql-test/suite/mariabackup/incremental_encrypted.test
0 → 100644
View file @
ca24f35b
if
(
!
$EXAMPLE_KEY_MANAGEMENT_SO
)
{
--
skip
needs
example_key_management
plugin
}
call
mtr
.
add_suppression
(
"InnoDB: New log files created"
);
let
$basedir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
let
$incremental_dir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup_inc1
;
CREATE
TABLE
t
(
i
INT
)
ENGINE
INNODB
ENCRYPTED
=
YES
;
INSERT
INTO
t
VALUES
(
1
);
echo
# Create full backup , modify table, then create incremental/differential backup;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$basedir
;
--
enable_result_log
INSERT
INTO
t
VALUES
(
2
);
SELECT
*
FROM
t
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$incremental_dir
--
incremental
-
basedir
=
$basedir
;
echo
# Prepare full backup, apply incremental one;
exec
$XTRABACKUP
--
prepare
--
apply
-
log
-
only
--
target
-
dir
=
$basedir
;
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$basedir
--
incremental
-
dir
=
$incremental_dir
;
# stats also can support encryption, but needs plugin-load and plugin variables, they are stored in backup-my.cnf
# We need to prepare again to create log files though.
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$basedir
;
exec
$XTRABACKUP
--
defaults
-
file
=
$basedir
/
backup
-
my
.
cnf
--
stats
--
datadir
=
$basedir
;
echo
# Restore and check results;
let
$targetdir
=
$basedir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
SELECT
*
FROM
t
;
DROP
TABLE
t
;
# Cleanup
rmdir
$basedir
;
rmdir
$incremental_dir
;
mysql-test/suite/mariabackup/partial.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t1(i INT) ENGINE INNODB;
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(i int) ENGINE INNODB;
# xtrabackup backup
t1.ibd
# xtrabackup prepare
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SELECT * FROM t1;
i
1
DROP TABLE t1;
DROP TABLE t2;
mysql-test/suite/mariabackup/partial.test
0 → 100644
View file @
ca24f35b
# Export single table from backup
# (xtrabackup with --prepare --export)
CREATE
TABLE
t1
(
i
INT
)
ENGINE
INNODB
;
INSERT
INTO
t1
VALUES
(
1
);
CREATE
TABLE
t2
(
i
int
)
ENGINE
INNODB
;
echo
# xtrabackup backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
"--tables=test.*1"
--
target
-
dir
=
$targetdir
;
--
enable_result_log
list_files
$targetdir
/
test
*.
ibd
;
echo
# xtrabackup prepare;
--
disable_result_log
exec
$XTRABACKUP
--
prepare
--
export
--
target
-
dir
=
$targetdir
;
--
enable_result_log
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
;
DROP
TABLE
t2
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/small_ibd.result
0 → 100644
View file @
ca24f35b
#backup
mysql-test/suite/mariabackup/small_ibd.test
0 → 100644
View file @
ca24f35b
# Check if ibd smaller than page size are skipped
# It is possible, due to race conditions that new file
# is created by server while xtrabackup is running
# The first page in this file does not yet exist.
# xtrabackup should skip such file.
let
$_datadir
=
`SELECT @@datadir`
;
write_file
$_datadir
/
test
/
small
.
ibd
;
EOF
echo
#backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$targetdir
;
--
enable_result_log
remove_file
$_datadir
/
test
/
small
.
ibd
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/suite.opt
0 → 100644
View file @
ca24f35b
--innodb --changed_page_bitmaps --innodb-file-format=Barracuda
\ No newline at end of file
mysql-test/suite/mariabackup/suite.pm
0 → 100644
View file @
ca24f35b
package
My::Suite::
MariaBackup
;
@ISA
=
qw(My::Suite)
;
use
My::
Find
;
use
File::
Basename
;
use
strict
;
return
"
Not run for embedded server
"
if
$::opt_embedded_server
;
my
$mariabackup_exe
=
::
mtr_exe_maybe_exists
(
"
$::bindir/extra/mariabackup$::opt_vs_config/mariabackup
",
"
$::path_client_bindir/mariabackup
");
return
"
No mariabackup
"
if
!
$mariabackup_exe
;
$ENV
{
XTRABACKUP
}
=
$mariabackup_exe
;
$ENV
{
XBSTREAM
}
=
::
mtr_exe_maybe_exists
(
"
$::bindir/extra/mariabackup/$::opt_vs_config/mbstream
",
"
$::path_client_bindir/mbstream
");
my
$tar_version
=
`
tar --version 2>&1
`;
$ENV
{
HAVE_TAR
}
=
$!
?
0
:
1
;
my
$mariabackup_help
=
`
$mariabackup_exe
--help 2>&1
`;
$ENV
{
HAVE_XTRABACKUP_TAR_SUPPORT
}
=
(
index
(
$mariabackup_help
,"
'tar'
")
==
-
1
)
?
0
:
1
;
$ENV
{
INNOBACKUPEX
}
=
"
$mariabackup_exe
--innobackupex
";
sub
skip_combinations
{
my
%
skip
;
$skip
{'
include/have_file_key_management.inc
'}
=
'
needs file_key_management plugin
'
unless
$ENV
{
FILE_KEY_MANAGEMENT_SO
};
%
skip
;
}
bless
{
};
mysql-test/suite/mariabackup/tar.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup
# xtrabackup prepare
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * FROM t;
i
1
DROP TABLE t;
mysql-test/suite/mariabackup/tar.test
0 → 100644
View file @
ca24f35b
if
(
`select $HAVE_TAR = 0`
)
{
--
skip
No
tar
}
if
(
`select $HAVE_XTRABACKUP_TAR_SUPPORT = 0`
)
{
--
skip
Compiled
without
libarchive
}
CREATE
TABLE
t
(
i
INT
)
ENGINE
INNODB
;
INSERT
INTO
t
VALUES
(
1
);
echo
# xtrabackup backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
let
$streamfile
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
tar
;
mkdir
$targetdir
;
exec
$XTRABACKUP
"--defaults-file=
$MYSQLTEST_VARDIR
/my.cnf"
--
backup
--
stream
=
tar
>
$streamfile
2
>
$targetdir
/
backup_stream
.
log
;
--
disable_result_log
exec
tar
-
C
$targetdir
-
x
<
$streamfile
;
echo
# xtrabackup prepare;
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
SELECT
*
FROM
t
;
DROP
TABLE
t
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/xb_aws_key_management.opt
0 → 100644
View file @
ca24f35b
--plugin-load-add=$AWS_KEY_MANAGEMENT_SO
--loose-aws-key-management
--loose-aws-key-management-master-key-id=$AWS_KEY_MANAGEMENT_MASTER_KEY_ID
mysql-test/suite/mariabackup/xb_aws_key_management.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
INSERT INTO t VALUES('foobar1');
# xtrabackup backup
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * from t;
c
foobar1
DROP TABLE t;
mysql-test/suite/mariabackup/xb_aws_key_management.test
0 → 100644
View file @
ca24f35b
if
(
`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'aws_key_management' AND PLUGIN_STATUS='ACTIVE'`
)
{
--
skip
needs
aws_key_management
plugin
plugin
}
if
(
`SELECT @@aws_key_management_master_key_id=''`
)
{
--
skip
Test
requires
AWS_KEY_MANAGEMEMENT_MASTER_KEY_ID
env
.
variable
}
CREATE
TABLE
t
(
c
VARCHAR
(
10
))
ENGINE
INNODB
encrypted
=
yes
;
INSERT
INTO
t
VALUES
(
'foobar1'
);
echo
# xtrabackup backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$targetdir
;
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
SELECT
*
from
t
;
DROP
TABLE
t
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
0 → 100644
View file @
ca24f35b
--innodb-encryption-rotate-key-age=2
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
--innodb_strict_mode
--innodb_file_per_table
--innodb_file_format=Barracuda
mysql-test/suite/mariabackup/xb_compressed_encrypted.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t1(c1 INT, b VARCHAR(2400), index(b(100),c1)) ENGINE=INNODB ROW_FORMAT=compressed ENCRYPTED=YES;
CREATE PROCEDURE innodb_insert_proc (REPEAT_COUNT INT)
BEGIN
DECLARE CURRENT_NUM INT;
SET CURRENT_NUM = 0;
WHILE CURRENT_NUM < REPEAT_COUNT DO
INSERT INTO t1 VALUES(CURRENT_NUM, concat(uuid(), CURRENT_NUM, repeat('ab', floor(rand()*100) ), uuid()));
SET CURRENT_NUM = CURRENT_NUM + 1;
END WHILE;
END//
COMMIT;
SET AUTOCOMMIT=0;
CALL innodb_insert_proc(50000);
COMMIT;
# xtrabackup backup
drop table t1;
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
select sum(c1) from t1;
sum(c1)
1249975000
DROP TABLE t1;
drop procedure innodb_insert_proc;
mysql-test/suite/mariabackup/xb_compressed_encrypted.test
0 → 100644
View file @
ca24f35b
source
include
/
have_file_key_management
.
inc
;
CREATE
TABLE
t1
(
c1
INT
,
b
VARCHAR
(
2400
),
index
(
b
(
100
),
c1
))
ENGINE
=
INNODB
ROW_FORMAT
=
compressed
ENCRYPTED
=
YES
;
DELIMITER
//;
CREATE
PROCEDURE
innodb_insert_proc
(
REPEAT_COUNT
INT
)
BEGIN
DECLARE
CURRENT_NUM
INT
;
SET
CURRENT_NUM
=
0
;
WHILE
CURRENT_NUM
<
REPEAT_COUNT
DO
INSERT
INTO
t1
VALUES
(
CURRENT_NUM
,
concat
(
uuid
(),
CURRENT_NUM
,
repeat
(
'ab'
,
floor
(
rand
()
*
100
)
),
uuid
()));
SET
CURRENT_NUM
=
CURRENT_NUM
+
1
;
END
WHILE
;
END
//
DELIMITER
;
//
COMMIT
;
SET
AUTOCOMMIT
=
0
;
CALL
innodb_insert_proc
(
50000
);
COMMIT
;
echo
# xtrabackup backup;
--
disable_result_log
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
exec
$INNOBACKUPEX
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
no
-
timestamp
$targetdir
;
drop
table
t1
;
exec
$INNOBACKUPEX
--
apply
-
log
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
select
sum
(
c1
)
from
t1
;
DROP
TABLE
t1
;
drop
procedure
innodb_insert_proc
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/xb_file_key_management.opt
0 → 100644
View file @
ca24f35b
--innodb-encrypt-log=ON
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management
--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key
--loose-file-key-management-filename=$MTR_SUITE_DIR/filekeys-data.enc
--loose-file-key-management-encryption-algorithm=aes_cbc
mysql-test/suite/mariabackup/xb_file_key_management.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
INSERT INTO t VALUES('foobar1');
# xtrabackup backup
NOT FOUND /foobar1/ in xtrabackup_logfile
# expect NOT FOUND
INSERT INTO t VALUES('foobar2');
# xtrabackup prepare
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
NOT FOUND /foobar1/ in xtrabackup_logfile
# expect NOT FOUND
SELECT * FROM t;
c
foobar1
DROP TABLE t;
mysql-test/suite/mariabackup/xb_file_key_management.test
0 → 100644
View file @
ca24f35b
source
include
/
have_file_key_management
.
inc
;
CREATE
TABLE
t
(
c
VARCHAR
(
10
))
ENGINE
INNODB
encrypted
=
yes
;
INSERT
INTO
t
VALUES
(
'foobar1'
);
echo
# xtrabackup backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
target
-
dir
=
$targetdir
;
--
enable_result_log
--
let
SEARCH_RANGE
=
10000000
--
let
SEARCH_PATTERN
=
foobar1
--
let
SEARCH_FILE
=
$targetdir
/
xtrabackup_logfile
--
source
include
/
search_pattern_in_file
.
inc
--
echo
# expect NOT FOUND
INSERT
INTO
t
VALUES
(
'foobar2'
);
echo
# xtrabackup prepare;
--
disable_result_log
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$targetdir
;
exec
$XTRABACKUP
--
defaults
-
file
=
$targetdir
/
backup
-
my
.
cnf
--
stats
--
datadir
=
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
#
# Recheck that plain text data (
# in not in the log, after prepare
# (MDEV-11538)
--
let
SEARCH_RANGE
=
10000000
--
let
SEARCH_PATTERN
=
foobar1
--
let
SEARCH_FILE
=
$targetdir
/
xtrabackup_logfile
--
source
include
/
search_pattern_in_file
.
inc
--
echo
# expect NOT FOUND
SELECT
*
FROM
t
;
DROP
TABLE
t
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
0 → 100644
View file @
ca24f35b
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--innodb_strict_mode
--innodb_file_per_table
--innodb-encryption-rotate-key-age=2
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
--loose-file-key-management
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
\ No newline at end of file
mysql-test/suite/mariabackup/xb_fulltext_encrypted.result
0 → 100644
View file @
ca24f35b
CREATE TABLE film_text (
film_id SMALLINT NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT,
PRIMARY KEY (film_id),
FULLTEXT KEY idx_title_description (title,description),
FULLTEXT KEY (description),
FULLTEXT KEY (title)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 ENCRYPTED=YES;
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
drop table film_text;
mysql-test/suite/mariabackup/xb_fulltext_encrypted.test
0 → 100644
View file @
ca24f35b
source
include
/
have_file_key_management
.
inc
;
CREATE
TABLE
film_text
(
film_id
SMALLINT
NOT
NULL
,
title
VARCHAR
(
255
)
NOT
NULL
,
description
TEXT
,
PRIMARY
KEY
(
film_id
),
FULLTEXT
KEY
idx_title_description
(
title
,
description
),
FULLTEXT
KEY
(
description
),
FULLTEXT
KEY
(
title
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
ENCRYPTED
=
YES
;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$INNOBACKUPEX
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
no
-
timestamp
$targetdir
;
exec
$INNOBACKUPEX
--
apply
-
log
--
rebuild
-
indexes
--
rebuild
-
threads
=
2
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
drop
table
film_text
;
mysql-test/suite/mariabackup/xb_history.result
0 → 100644
View file @
ca24f35b
SELECT COUNT(*) FROM PERCONA_SCHEMA.xtrabackup_history;
COUNT(*)
1
DROP TABLE PERCONA_SCHEMA.xtrabackup_history;
DROP DATABASE PERCONA_SCHEMA;
mysql-test/suite/mariabackup/xb_history.test
0 → 100644
View file @
ca24f35b
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
history
=
foo
--
backup
--
target
-
dir
=
$targetdir
;
--
enable_result_log
SELECT
COUNT
(
*
)
FROM
PERCONA_SCHEMA
.
xtrabackup_history
;
DROP
TABLE
PERCONA_SCHEMA
.
xtrabackup_history
;
DROP
DATABASE
PERCONA_SCHEMA
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/xb_page_compress.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1;
CREATE PROCEDURE innodb_insert_proc (REPEAT_COUNT INT)
BEGIN
DECLARE CURRENT_NUM INT;
SET CURRENT_NUM = 0;
WHILE CURRENT_NUM < REPEAT_COUNT DO
INSERT INTO t1 VALUES(CURRENT_NUM,'TESTING..');
SET CURRENT_NUM = CURRENT_NUM + 1;
END WHILE;
END//
COMMIT;
SET AUTOCOMMIT=0;
CALL innodb_insert_proc(5000);
COMMIT;
SELECT (VARIABLE_VALUE >= 0) AS HAVE_COMPRESSED_PAGES
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
HAVE_COMPRESSED_PAGES
1
# xtrabackup backup
# xtrabackup prepare
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1;
mysql-test/suite/mariabackup/xb_page_compress.test
0 → 100644
View file @
ca24f35b
CREATE
TABLE
t1
(
c1
INT
,
b
CHAR
(
20
))
ENGINE
=
INNODB
PAGE_COMPRESSED
=
1
;
DELIMITER
//;
CREATE
PROCEDURE
innodb_insert_proc
(
REPEAT_COUNT
INT
)
BEGIN
DECLARE
CURRENT_NUM
INT
;
SET
CURRENT_NUM
=
0
;
WHILE
CURRENT_NUM
<
REPEAT_COUNT
DO
INSERT
INTO
t1
VALUES
(
CURRENT_NUM
,
'TESTING..'
);
SET
CURRENT_NUM
=
CURRENT_NUM
+
1
;
END
WHILE
;
END
//
DELIMITER
;
//
COMMIT
;
SET
AUTOCOMMIT
=
0
;
CALL
innodb_insert_proc
(
5000
);
COMMIT
;
SELECT
(
VARIABLE_VALUE
>=
0
)
AS
HAVE_COMPRESSED_PAGES
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'INNODB_NUM_PAGES_PAGE_COMPRESSED'
;
echo
# xtrabackup backup;
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
"--tables=test.*1"
--
target
-
dir
=
$targetdir
;
echo
# xtrabackup prepare;
exec
$XTRABACKUP
--
prepare
--
export
--
target
-
dir
=
$targetdir
;
--
enable_result_log
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
COUNT
(
*
)
FROM
t1
;
DROP
PROCEDURE
innodb_insert_proc
;
DROP
TABLE
t1
;
rmdir
$targetdir
;
mysql-test/suite/mariabackup/xb_partition.result
0 → 100644
View file @
ca24f35b
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);
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);
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * from p;
a
201
301
401
501
SELECT * from isam_p;
a
201
301
401
501
DROP TABLE isam_p;
DROP TABLE isam_t2;
DROP TABLE p;
DROP TABLE t2;
mysql-test/suite/mariabackup/xb_partition.test
0 → 100644
View file @
ca24f35b
--
source
include
/
have_partition
.
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
--
no
-
timestamp
--
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
--
redo
-
only
$targetdir
/
full
;
exec
$INNOBACKUPEX
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
apply
-
log
--
redo
-
only
--
incremental
-
dir
=
$targetdir
/
inc
$targetdir
/
full
;
exec
$INNOBACKUPEX
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
apply
-
log
$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
;
mysql-test/suite/mariabackup/xbstream.result
0 → 100644
View file @
ca24f35b
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup to stream
# xbstream extract
# xtrabackup prepare
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * FROM t;
i
1
DROP TABLE t;
mysql-test/suite/mariabackup/xbstream.test
0 → 100644
View file @
ca24f35b
CREATE
TABLE
t
(
i
INT
)
ENGINE
INNODB
;
INSERT
INTO
t
VALUES
(
1
);
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
mkdir
$targetdir
;
let
$streamfile
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
xb
;
echo
# xtrabackup backup to stream;
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
stream
=
xbstream
>
$streamfile
2
>
$targetdir
/
backup_stream
.
log
;
echo
# xbstream extract;
--
disable_result_log
exec
$XBSTREAM
-
x
-
C
$targetdir
<
$streamfile
;
echo
# xtrabackup prepare;
exec
$XTRABACKUP
--
prepare
--
target
-
dir
=
$targetdir
;
--
source
include
/
restart_and_restore
.
inc
--
enable_result_log
SELECT
*
FROM
t
;
DROP
TABLE
t
;
rmdir
$targetdir
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment