Skip to content

Commit ea83c1d

Browse files
author
Jan Lindström
committed
MDEV-9977: Crash when accessing large (>4G) InnoDB table on
MariaDB 10.1.x 32-bit binaries. Problem was the fact that tablespace size was incorrectly rounded to next extent size (1M).
1 parent 732adec commit ea83c1d

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,9 @@ fil_node_open_file(
737737
}
738738
}
739739

740-
if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
740+
if (size_bytes >= (1024*1024)) {
741741
/* Truncate the size to whole extent size. */
742-
size_bytes = ut_2pow_round(size_bytes,
743-
FSP_EXTENT_SIZE *
744-
UNIV_PAGE_SIZE);
742+
size_bytes = ut_2pow_round(size_bytes, (1024*1024));
745743
}
746744

747745
if (!fsp_flags_is_compressed(flags)) {

storage/xtradb/fil/fil0fil.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,9 @@ fil_node_open_file(
739739
}
740740
}
741741

742-
if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
742+
if (size_bytes >= (1024*1024)) {
743743
/* Truncate the size to whole extent size. */
744-
size_bytes = ut_2pow_round(size_bytes,
745-
FSP_EXTENT_SIZE *
746-
UNIV_PAGE_SIZE);
744+
size_bytes = ut_2pow_round(size_bytes, (1024*1024));
747745
}
748746

749747
if (!fsp_flags_is_compressed(flags)) {
@@ -5683,7 +5681,7 @@ fil_space_get_node(
56835681
/* Found! */
56845682
break;
56855683
} else {
5686-
*block_offset -= node->size;
5684+
(*block_offset) -= node->size;
56875685
node = UT_LIST_GET_NEXT(chain, node);
56885686
}
56895687
}

0 commit comments

Comments
 (0)