MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Satya B Date:August 31 2009 8:40am
Subject:bzr commit into mysql-5.0-bugteam branch (satya.bn:2794) Bug#33785
View as plain text  
#At file:///home/satya/WORK/33785/mysql-5.0-bugteam-33785/ based on revid:anurag.shekhar@stripped

 2794 Satya B	2009-08-31
      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
      
      Max values for the modified variables (from mysqld.cc)
      -------------------------------------
      1. key_buffer_size
         5.0: ULONG_MAX
         5.1: SIZE_T_MAX
         6.0: SIZE_T_MAX
      
      2. read_buffer_size and write_buffer_size
         5.0: INT_MAX32
         5.1: INT_MAX32
         6.0: INT_MAX32
      
      3. sort_buffer_size (aka myisam_sort_buffer_size)
         5.0: UINT_MAX32
         5.1: ULONG_MAX
         6.0: ULONG_MAX
      
      Note: testcase not attached
      modified:
        myisam/myisamchk.c

per-file messages:
  myisam/myisamchk.c
    Bug#33785 - myisamchk show warning message
    
    Fixed the Max value for key_buffer_size, read_buffer_size, write_buffer_size and
    sort_buffer_size options
=== modified file 'myisam/myisamchk.c'
--- a/myisam/myisamchk.c	2009-04-08 11:15:43 +0000
+++ b/myisam/myisamchk.c	2009-08-31 08:40:34 +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_MAX, (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},
+    INT_MAX32, (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},
+    INT_MAX32, (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},
+    UINT_MAX32, (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,

Thread
bzr commit into mysql-5.0-bugteam branch (satya.bn:2794) Bug#33785Satya B31 Aug
  • Re: bzr commit into mysql-5.0-bugteam branch (satya.bn:2794) Bug#33785Sergey Vojtovich1 Sep