MDEV-30122 mariabackup.skip_innodb crashes when innodb_undo_tablespaces > 0

- Assign srv_undo_space_id_start when InnoDB opens extra unused
InnoDB undo tablespaces in srv_all_undo_tablespaces_open().
Mariabackup can detect the undo tablespaces using
srv_undo_space_id_start variable
parent 936436ef
--source include/innodb_undo_tablespaces.inc
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
CREATE TABLE t(i int);
INSERT INTO t VALUES(1);
......@@ -9,4 +10,4 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
SELECT * from t;
DROP TABLE t;
rmdir $targetdir;
\ No newline at end of file
rmdir $targetdir;
......@@ -817,9 +817,11 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_undo,
{
char name[OS_FILE_MAX_PATH];
snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i);
if (!srv_undo_tablespace_open(create_new_undo, name, i))
uint32_t space_id= srv_undo_tablespace_open(create_new_undo, name, i);
if (!space_id)
break;
++srv_undo_tablespaces_open;
if (0 == srv_undo_tablespaces_open++)
srv_undo_space_id_start= space_id;
}
return DB_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment