#At file:///home/satya/WORK/33785/mysql-5.0-bugteam-33785/ based on revid:joro@stripped
2790 Satya B 2009-08-21
Fix for Bug #33785 - myisamchk show warning message
myisamchk tool generates warnings when run on an myisam files (.MYI or .MYD)
This is because of the conversion of max_value for certain options in myisamchk
from singed long to unsigned long
The max value for the options key_buffer_size, read_buffer_size, write_buffer
_size and sort_buffer_size is given as (long) ~0L which becomes -1 when signed
convention is used and generates errors from getopt_ull_limit_value() due to
conversion of signed long to unsigned long.
Fixed by using the right max size which should be unsigned long.
Note: testcase not attached
modified:
myisam/myisamchk.c
per-file messages:
myisam/myisamchk.c
Bug #33785 - myisamchk show warning message
Changed the max value for the key_buffer_size, read_buffer_size, write_bufer_
size and sort_buffer_size to (ulong) ~OL
=== modified file 'myisam/myisamchk.c'
--- a/myisam/myisamchk.c 2009-04-08 11:15:43 +0000
+++ b/myisam/myisamchk.c 2009-08-21 12:43:49 +0000
@@ -295,7 +295,7 @@ static struct my_option my_long_options[
{ "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
(gptr*) &check_param.use_buffers, (gptr*) &check_param.use_buffers, 0,
GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD,
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
+ (ulong) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
{ "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, "",
(gptr*) &opt_key_cache_block_size,
(gptr*) &opt_key_cache_block_size, 0,
@@ -309,17 +309,17 @@ static struct my_option my_long_options[
(gptr*) &check_param.read_buffer_length,
(gptr*) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ (ulong) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "",
(gptr*) &check_param.write_buffer_length,
(gptr*) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ (ulong) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
(gptr*) &check_param.sort_buffer_length,
(gptr*) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ (ulong) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "",
(gptr*) &check_param.sort_key_blocks,
(gptr*) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,