Commit ea83c1d7 authored by Jan Lindström's avatar Jan Lindström

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).
parent 732adec0
...@@ -737,11 +737,9 @@ fil_node_open_file( ...@@ -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. */ /* Truncate the size to whole extent size. */
size_bytes = ut_2pow_round(size_bytes, size_bytes = ut_2pow_round(size_bytes, (1024*1024));
FSP_EXTENT_SIZE *
UNIV_PAGE_SIZE);
} }
if (!fsp_flags_is_compressed(flags)) { if (!fsp_flags_is_compressed(flags)) {
......
...@@ -739,11 +739,9 @@ fil_node_open_file( ...@@ -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. */ /* Truncate the size to whole extent size. */
size_bytes = ut_2pow_round(size_bytes, size_bytes = ut_2pow_round(size_bytes, (1024*1024));
FSP_EXTENT_SIZE *
UNIV_PAGE_SIZE);
} }
if (!fsp_flags_is_compressed(flags)) { if (!fsp_flags_is_compressed(flags)) {
...@@ -5683,7 +5681,7 @@ fil_space_get_node( ...@@ -5683,7 +5681,7 @@ fil_space_get_node(
/* Found! */ /* Found! */
break; break;
} else { } else {
*block_offset -= node->size; (*block_offset) -= node->size;
node = UT_LIST_GET_NEXT(chain, node); node = UT_LIST_GET_NEXT(chain, node);
} }
} }
......
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