Commit ec379066 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-29321 Percona XtraDB 5.7 can't be upgrade to MariaDB 10.6 or above

In MySQL 5.7, rollback segments 1 to 32 are used for temporary tables,
which is an unnecessary file format change from MySQL 5.6.
This format change was avoided in MariaDB Server by
commit 124bae08 (MDEV-12289).

An upgrade from MySQL 5.7 would crash due to dereferencing a null pointer,
which is a regression due to
commit 0b47c126 (MDEV-13542).

trx_rseg_t::get(): Return nullptr if no tablespace exists. This is where
the upgrade would crash.

trx_rseg_mem_restore(): Return DB_TABLESPACE_NOT_FOUND if the
undo tablespace does not exist. This is likely dead code.
parent af552f29
...@@ -290,6 +290,11 @@ bool trx_rseg_read_wsrep_checkpoint(XID& xid) ...@@ -290,6 +290,11 @@ bool trx_rseg_read_wsrep_checkpoint(XID& xid)
buf_block_t *trx_rseg_t::get(mtr_t *mtr, dberr_t *err) const buf_block_t *trx_rseg_t::get(mtr_t *mtr, dberr_t *err) const
{ {
if (!space)
{
if (err) *err= DB_TABLESPACE_NOT_FOUND;
return nullptr;
}
return buf_page_get_gen(page_id(), 0, RW_X_LATCH, nullptr, return buf_page_get_gen(page_id(), 0, RW_X_LATCH, nullptr,
BUF_GET, mtr, err); BUF_GET, mtr, err);
} }
...@@ -435,6 +440,8 @@ static dberr_t trx_undo_lists_init(trx_rseg_t *rseg, trx_id_t &max_trx_id, ...@@ -435,6 +440,8 @@ static dberr_t trx_undo_lists_init(trx_rseg_t *rseg, trx_id_t &max_trx_id,
static dberr_t trx_rseg_mem_restore(trx_rseg_t *rseg, trx_id_t &max_trx_id, static dberr_t trx_rseg_mem_restore(trx_rseg_t *rseg, trx_id_t &max_trx_id,
mtr_t *mtr) mtr_t *mtr)
{ {
if (!rseg->space)
return DB_TABLESPACE_NOT_FOUND;
dberr_t err; dberr_t err;
const buf_block_t *rseg_hdr= const buf_block_t *rseg_hdr=
buf_page_get_gen(rseg->page_id(), 0, RW_S_LATCH, nullptr, BUF_GET, mtr, buf_page_get_gen(rseg->page_id(), 0, RW_S_LATCH, nullptr, BUF_GET, mtr,
......
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