Skip to content

Commit

Permalink
MDEV-9977: Crash when accessing large (>4G) InnoDB table on
Browse files Browse the repository at this point in the history
MariaDB 10.1.x 32-bit binaries.

Problem was the fact that tablespace size was incorrectly
rounded to next extent size (1M).
  • Loading branch information
Jan Lindström committed Apr 28, 2016
1 parent 732adec commit ea83c1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions storage/innobase/fil/fil0fil.cc
Expand Up @@ -737,11 +737,9 @@ fil_node_open_file(
}
}

if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
if (size_bytes >= (1024*1024)) {
/* Truncate the size to whole extent size. */
size_bytes = ut_2pow_round(size_bytes,
FSP_EXTENT_SIZE *
UNIV_PAGE_SIZE);
size_bytes = ut_2pow_round(size_bytes, (1024*1024));
}

if (!fsp_flags_is_compressed(flags)) {
Expand Down
8 changes: 3 additions & 5 deletions storage/xtradb/fil/fil0fil.cc
Expand Up @@ -739,11 +739,9 @@ fil_node_open_file(
}
}

if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
if (size_bytes >= (1024*1024)) {
/* Truncate the size to whole extent size. */
size_bytes = ut_2pow_round(size_bytes,
FSP_EXTENT_SIZE *
UNIV_PAGE_SIZE);
size_bytes = ut_2pow_round(size_bytes, (1024*1024));
}

if (!fsp_flags_is_compressed(flags)) {
Expand Down Expand Up @@ -5683,7 +5681,7 @@ fil_space_get_node(
/* Found! */
break;
} else {
*block_offset -= node->size;
(*block_offset) -= node->size;
node = UT_LIST_GET_NEXT(chain, node);
}
}
Expand Down

0 comments on commit ea83c1d

Please sign in to comment.