diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-04 12:26:48 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-04 12:26:48 +0200 |
commit | 251fa7ffc59f236a8c493465519bc70152466385 (patch) | |
tree | 20aaea2d37ae1f621d3a2a11f587cab9feda770f /storage/xtradb/fil | |
parent | 43f185e171eecdce41e71c548ce0bc2bd6969c0f (diff) | |
download | mariadb-git-251fa7ffc59f236a8c493465519bc70152466385.tar.gz |
Fix error on trim operation alligment. Furthermore, make sure that
we do not return simulated out of file space on read operation,
that would cause crash.
Diffstat (limited to 'storage/xtradb/fil')
-rw-r--r-- | storage/xtradb/fil/fil0pagecompress.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index a4b0e1b486b..3852bc49408 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -453,9 +453,15 @@ fil_compress_page( /* Actual write needs to be alligned on block size */ if (write_size % block_size) { +#ifdef UNIV_DEBUG + size_t tmp = write_size; ut_a(block_size > 0); - write_size = (write_size + block_size-1) & ~(block_size-1); - ut_a((write_size % block_size) == 0); +#endif + write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size); +#ifdef UNIV_DEBUG + ut_a(write_size > 0 && ((write_size % block_size) == 0)); + ut_a(write_size >= tmp); +#endif } #ifdef UNIV_PAGECOMPRESS_DEBUG |