List:General Discussion« Previous MessageNext Message »
From:Thomas Spahni Date:June 18 2009 11:32am
Subject:Re: myisamchk buffer_size warnings
View as plain text  
On Tue, 16 Jun 2009, Thomas Spahni wrote:

> Hi
>
> I have MySQL 5.0.64 compiled from source. When I run myisamchk on any
> table I get the following warnings:
>
> Warning: option 'key_buffer_size': unsigned value 18446744073709551615 
> adjusted to 4294963200
> Warning: option 'read_buffer_size': unsigned value 18446744073709551615 
> adjusted to 4294967295
> Warning: option 'write_buffer_size': unsigned value 18446744073709551615 
> adjusted to 4294967295
> Warning: option 'sort_buffer_size': unsigned value 18446744073709551615 
> adjusted to 4294967295
>
> /etc/my.cnf contains the following:
>
> [myisamchk]
> key_buffer_size=20971520
> sort_buffer_size=20971520
> read_buffer_size=2097152
> write_buffer_size=2097152
>
> What's wrong here?
> Thomas Spahni

Hi all,

Replying to myself as the problem is fixed in the meantime (at least for 
me). It turned out to be bug #33785 described here:

<http://bugs.mysql.com/bug.php?id=33785>

The solution is to fix the source code of myisamchk.c and recompile. The 
diff is:

--- myisamchk.c.original	2009-06-18 13:01:55.000000000 +0200
+++ myisamchk.c	2009-06-18 13:17:34.000000000 +0200
@@ -295,7 +295,7 @@
    { "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) ~0, (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 @@
      (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) ~0, (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) ~0, (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) ~0, (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,


Unfortunately MySQL 5.0.64 is packed with SuSE-11.1 and thus a lot of 
installations will be broken. Some evil things may happen when you have 
less physical memory than the maximum default values as applied by the 
broken code.

Thomas
Thread
myisamchk buffer_size warningsThomas Spahni16 Jun
  • Re: myisamchk buffer_size warningsThomas Spahni18 Jun
Re: myisamchk buffer_size warningsThomas Spahni17 Jun