Percona Server with XtraDB

MyISAM repair-by-sort buffer cannot be > 4 GB even on 64-bit architectures

Reported by Alexey Kopytov on 2011-10-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server
Undecided
Alexey Kopytov
5.1
Undecided
Alexey Kopytov
5.5
Undecided
Alexey Kopytov

Bug Description

Description:
This applies to both server's myisam_sort_buffer_size and myisamchk
--sort_buffer_size. Even though both options are declared as GET_ULONG
which theoretically allows them to be greater than 4 GB on 64-bit
architectures (with 64-bit Windows being an exception), their value is
eventually cast to uint in _create_index_by_sort().

As a result, a wrap-around value is actually used as a buffer size. When
the wrap-around value is 0, _create_index_by_sort() fails with a
spurious "myisam_sort_buffer_size is too small" error.

How to repeat:
Try using myisam_sort_buffer_size=4G or "myisamchk -r --sort_buffer_size=4G" on a 64-bit
machine.

Suggested fix:
Remove casts to uint in _create_index_by_sort() and calls to it. Better yet, declare the
options as GET_ULL with SIZE_T_MAX as their max allowed value, and change all relevant
variables from ulong to ulonglong to fix 64-bit Windows as well.

tags: added: cr i19156
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.