summaryrefslogtreecommitdiff
path: root/storage/innobase/trx/trx0undo.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-23 09:24:32 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-23 09:24:32 +0300
commit3a566de22db6990faf213f483a722645c1ad8b9e (patch)
tree004180770a845d5057619ab85d7af1233631bc88 /storage/innobase/trx/trx0undo.cc
parent9fc67c6bf3b9af632cb80c836e3ec912778d8906 (diff)
parent344e59904d58ff880e4a752c057c5d246552db23 (diff)
downloadmariadb-git-3a566de22db6990faf213f483a722645c1ad8b9e.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'storage/innobase/trx/trx0undo.cc')
-rw-r--r--storage/innobase/trx/trx0undo.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index 82082f70e58..a6166da62fc 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -845,18 +845,11 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no,
const uint16_t type = mach_read_from_2(TRX_UNDO_PAGE_HDR
+ TRX_UNDO_PAGE_TYPE
+ block->frame);
- switch (type) {
- case 0:
- case 2: /* TRX_UNDO_UPDATE */
- break;
- case 1: /* TRX_UNDO_INSERT */
- sql_print_error("InnoDB: upgrade from older version than"
- " MariaDB 10.3 requires clean shutdown");
- goto corrupted;
- default:
+ if (UNIV_UNLIKELY(type > 2)) {
+corrupted_type:
sql_print_error("InnoDB: unsupported undo header type %u",
type);
- corrupted:
+corrupted:
mtr.commit();
return nullptr;
}
@@ -876,12 +869,21 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no,
switch (state) {
case TRX_UNDO_ACTIVE:
case TRX_UNDO_PREPARED:
- break;
+ if (UNIV_LIKELY(type != 1)) {
+ break;
+ }
+ sql_print_error("InnoDB: upgrade from older version than"
+ " MariaDB 10.3 requires clean shutdown");
+ goto corrupted;
default:
sql_print_error("InnoDB: unsupported undo header state %u",
state);
goto corrupted;
case TRX_UNDO_TO_PURGE:
+ if (UNIV_UNLIKELY(type == 1)) {
+ goto corrupted_type;
+ }
+ /* fall through */
case TRX_UNDO_CACHED:
trx_id_t id = mach_read_from_8(TRX_UNDO_TRX_NO + undo_header);
if (id >> 48) {