Skip to content

Commit 2749d25

Browse files
author
Jan Lindström
committed
MDEV-13499: Backing up table that "doesn't exist in engine" cause crash in mariabackup when using encryption
Problem was that there is intentional crah when .ibd file does not found. In mariabackup case we should avoid this crash.
1 parent f9179b3 commit 2749d25

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
create table t1(c1 int) engine=InnoDB;
2+
INSERT INTO t1 VALUES(1);
3+
# xtrabackup backup
4+
select * from t1;
5+
ERROR 42S02: Table 'test.t1' doesn't exist in engine
6+
drop table t1;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--source include/have_innodb.inc
2+
3+
#
4+
# MDEV-13499: Backing up table that "doesn't exist in engine" cause crash in mariabackup when using encryption
5+
#
6+
create table t1(c1 int) engine=InnoDB;
7+
INSERT INTO t1 VALUES(1);
8+
let MYSQLD_DATADIR=`select @@datadir`;
9+
10+
--source include/shutdown_mysqld.inc
11+
12+
--remove_file $MYSQLD_DATADIR/test/t1.ibd
13+
14+
--source include/start_mysqld.inc
15+
16+
echo # xtrabackup backup;
17+
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
18+
--disable_result_log
19+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
20+
--enable_result_log
21+
22+
rmdir $targetdir;
23+
24+
--error ER_NO_SUCH_TABLE_IN_ENGINE
25+
select * from t1;
26+
drop table t1;
27+

storage/xtradb/fil/fil0fil.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2014, 2017, MariaDB Corporation.
4+
Copyright (c) 2014, 2018, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -4967,6 +4967,11 @@ fil_load_single_table_tablespace(
49674967
return;
49684968
}
49694969

4970+
/* In mariabackup lets not crash. */
4971+
if (IS_XTRABACKUP()) {
4972+
return;
4973+
}
4974+
49704975
abort();
49714976
}
49724977

0 commit comments

Comments
 (0)