List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:June 8 2010 7:16pm
Subject:bzr commit into mysql-5.1-bugteam branch (davi:3421) Bug#42733
View as plain text  
# At a local mysql-5.1-bugteam repository of davi

 3421 Davi Arnaut	2010-06-08
      Bug#42733: Type-punning warnings when compiling MySQL --
                 strict aliasing violations.
      
      Essentially, the problem is that large parts of the server were
      developed in simpler times (last decades, pre C99 standard) when
      strict aliasing and compilers supporting such optimizations were
      rare to non-existent. Thus, when compiling the server with a modern
      compiler that uses strict aliasing rules to perform optimizations,
      there are several places in the code that might trigger undefined
      behavior.
      
      As evinced by some recent bugs, GCC does a somewhat good of job
      misoptimizing such code, but on the other hand also gives warnings
      about suspicious code. One problem is that the warnings aren't
      always accurate, yet we can't afford to just shut them off as we
      might miss real cases. False-positive cases are aggravated mostly
      by casts that are likely to trigger undefined behavior.
      
      The solution is to start a cleanup process focused on fixing and
      reducing the amount of strict-aliasing related warnings produced
      by GCC and others compilers. A good deal of noise reduction can
      be achieved by just removing useless casts that are product of
      historical cruft and are likely to trigger undefined behavior if
      deferenced.
     @ client/mysql.cc
        Remove now-unnecessary casts.
        Break up large strings.
     @ client/mysql_upgrade.c
        Remove now-unnecessary casts.
     @ client/mysqladmin.cc
        Remove now-unnecessary casts.
        Break up large strings.
     @ client/mysqlbinlog.cc
        Remove now-unnecessary casts.
     @ client/mysqlcheck.c
        Remove now-unnecessary casts.
     @ client/mysqldump.c
        Remove now-unnecessary casts.
     @ client/mysqlimport.c
        Remove now-unnecessary casts.
     @ client/mysqlshow.c
        Remove now-unnecessary casts.
     @ client/mysqlslap.c
        Remove now-unnecessary casts.
     @ client/mysqltest.cc
        Remove now-unnecessary casts.
     @ extra/comp_err.c
        Remove now-unnecessary casts.
     @ extra/my_print_defaults.c
        Remove now-unnecessary casts.
        Break up large strings.
     @ extra/mysql_waitpid.c
        Remove now-unnecessary casts.
     @ extra/perror.c
        Remove now-unnecessary casts.
     @ extra/resolve_stack_dump.c
        Remove now-unnecessary casts.
     @ extra/resolveip.c
        Remove now-unnecessary casts.
     @ include/my_getopt.h
        Use a void pointer type as the opaque type to avoid problems with type
        incompatibility -- GCC issues warnings when the type name is not type
        compatible with a operand. As a side bonus, a explicit cast won't be
        necessary anymore.
     @ include/sslopt-longopts.h
        Remove now-unnecessary casts.
        Break up large strings.
     @ mysys/my_getopt.c
        Update opaque type and introduce a type definition for the
        argument to my_getopt_register_get_addr.
     @ server-tools/instance-manager/options.cc
        Remove now-unnecessary casts.
     @ sql/mysqld.cc
        Remove now-unnecessary casts.
        Break up large strings.
        Update mysql_getopt_value prototype (the old prototype
        was different from the definition anyway).
     @ sql/sql_plugin.cc
        The type of a pointer to a function must be compatible with the
        pointed-to function type, otherwise the behavior is undefined.
     @ sql/table.cc
        The variable buf pointer to pointer to pointer to constant char
        could improperly alias a incompatible type in call to fix_type_
        pointers. Since this was actually dead code, it is simply removed.
     @ sql/unireg.cc
        Remove call to get_form_pos. The code creates a new FRM file which
        is always truncated and writes the form position as 0. Hence, no
        need to retrieve it, we now for sure it is 0.
     @ storage/archive/archive_reader.c
        Remove now-unnecessary casts.
     @ storage/myisam/ft_nlq_search.c
        The value of a object of type int could be accessed via the type
        float, thus violating strict aliasing rules. Use a union for type
        punning.
     @ storage/myisam/fulltext.h
        Use the union type-punning technique to access a object via two
        incompatible types. Although not strictly standard conformant, the
        technique is often recommended (ie by GCC) and is quite portable.
     @ storage/myisam/mi_test1.c
        Remove now-unnecessary casts.
     @ storage/myisam/myisam_ftdump.c
        The value of a object of type int could be accessed via the type
        float, thus violating strict aliasing rules. Use a union for type
        punning.
     @ storage/myisam/myisamchk.c
        Remove now-unnecessary casts.
     @ storage/myisam/myisamlog.c
        A pointer to char was used to alias a pointer to pointer to
        unsigned char, thus violating strict aliasing rules.
     @ storage/myisam/myisampack.c
        Remove now-unnecessary casts.
     @ tests/mysql_client_test.c
        Remove now-unnecessary casts.

    modified:
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqladmin.cc
      client/mysqlbinlog.cc
      client/mysqlcheck.c
      client/mysqldump.c
      client/mysqlimport.c
      client/mysqlshow.c
      client/mysqlslap.c
      client/mysqltest.cc
      extra/comp_err.c
      extra/my_print_defaults.c
      extra/mysql_waitpid.c
      extra/perror.c
      extra/resolve_stack_dump.c
      extra/resolveip.c
      include/my_getopt.h
      include/sslopt-longopts.h
      mysys/mf_wfile.c
      mysys/my_getopt.c
      server-tools/instance-manager/options.cc
      sql/mysqld.cc
      sql/sql_plugin.cc
      sql/table.cc
      sql/unireg.cc
      storage/archive/archive_reader.c
      storage/myisam/ft_nlq_search.c
      storage/myisam/fulltext.h
      storage/myisam/mi_test1.c
      storage/myisam/myisam_ftdump.c
      storage/myisam/myisamchk.c
      storage/myisam/myisamlog.c
      storage/myisam/myisampack.c
      strings/decimal.c
      tests/mysql_client_test.c
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2010-03-11 13:16:54 +0000
+++ b/client/mysql.cc	2010-06-08 19:16:36 +0000
@@ -1348,7 +1348,7 @@ static struct my_option my_long_options[
 #endif
   {"auto-rehash", OPT_AUTO_REHASH,
    "Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
-   (uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+   &opt_rehash, &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
    0, 0},
   {"no-auto-rehash", 'A',
    "No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.",
@@ -1356,49 +1356,49 @@ static struct my_option my_long_options[
   {"batch", 'B',
    "Don't use history file. Disable interactive behavior. (Enables --silent.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
-   (uchar**) &column_types_flag, (uchar**) &column_types_flag,
+   &column_types_flag, &column_types_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"comments", 'c', "Preserve comments. Send comments to the server."
    " The default is --skip-comments (discard comments), enable with --comments.",
-   (uchar**) &preserve_comments, (uchar**) &preserve_comments,
+   &preserve_comments, &preserve_comments,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
 
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
    0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
-   (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"database", 'D', "Database to use.", (uchar**) &current_db,
-   (uchar**) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
+   &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"database", 'D', "Database to use.", &current_db,
+   &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str,
-   (uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"delimiter", OPT_DELIMITER, "Delimiter to be used.", &delimiter_str,
+   &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"vertical", 'E', "Print the output of a query (rows) vertically.",
-   (uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"named-commands", 'G',
    "Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
-   (uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &named_cmds, &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"no-named-commands", 'g',
    "Named commands are disabled. Use \\* form only, or use named commands "
@@ -1408,47 +1408,54 @@ static struct my_option my_long_options[
    "WARNING: option deprecated; use --disable-named-commands instead.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore-spaces", 'i', "Ignore space after function names.",
-   (uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_spaces, &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
-   (uchar**) &opt_local_infile,
-   (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
-   (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
-  {"host", 'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
+   &opt_local_infile,
+   &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
+   &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
+  {"host", 'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"html", 'H', "Produce HTML output.", &opt_html, &opt_html,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"xml", 'X', "Produce XML output.", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
+  {"xml", 'X', "Produce XML output.", &opt_xml, &opt_xml, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
-   (uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
+   &line_numbers, &line_numbers, 0, GET_BOOL,
    NO_ARG, 1, 0, 0, 0, 0, 0},  
   {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
-   (uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"unbuffered", 'n', "Flush buffer after each query.", &unbuffered,
+   &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
-   (uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
+   &column_names, &column_names, 0, GET_BOOL,
    NO_ARG, 1, 0, 0, 0, 0, 0},
   {"skip-column-names", 'N',
    "Don't write column names in results.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"set-variable", 'O',
-   "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
+   "Change the value of a variable. Please note that this option is "
+   "deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).",
-   (uchar**) &opt_sigint_ignore,  (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
+   &opt_sigint_ignore,  &opt_sigint_ignore, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"one-database", 'o',
-   "Only update the default database. This is useful for skipping updates to other database in the update log.",
+   "Only update the default database. This is useful for skipping updates "
+   "to other database in the update log.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef USE_POPEN
   {"pager", OPT_PAGER,
-   "Pager to use to display results. If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.",
+   "Pager to use to display results. If you don't supply an option, the "
+   "default pager is taken from your ENV variable PAGER. Valid pagers are "
+   "less, more, cat [> filename], etc. See interactive help (\\h) also. "
+   "This option does not work in batch mode. Disable with --disable-pager. "
+   "This option is disabled by default.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"no-pager", OPT_NOPAGER,
-   "Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
+   "Disable pager and print to stdout. See interactive help (\\h) also. "
+   "WARNING: option deprecated; use --disable-pager instead.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"password", 'p',
@@ -1464,48 +1471,53 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,  0},
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,  0},
   {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
-   (uchar**) &current_prompt, (uchar**) &current_prompt, 0, GET_STR_ALLOC,
+   &current_prompt, &current_prompt, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"quick", 'q',
-   "Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.",
-   (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Don't cache result, print it row by row. This may slow down the server "
+   "if the output is suspended. Doesn't use history file.",
+   &quick, &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"raw", 'r', "Write fields without conversion. Used with --batch.",
-   (uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_raw_data, &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
-  {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.", 
-   (uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-  {"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
-   0, 0},
+  {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable "
+   "with --disable-reconnect. This option is enabled by default.",
+   &opt_reconnect, &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"silent", 's', "Be more silent. Print results with a tab as separator, "
+   "each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, 
-   0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Base name of shared memory.", &shared_memory_base_name,
+   &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include "sslopt-longopts.h"
-  {"table", 't', "Output in table format.", (uchar**) &output_tables,
-   (uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"table", 't', "Output in table format.", &output_tables,
+   &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"tee", OPT_TEE,
-   "Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
+   "Append everything into outfile. See interactive help (\\h) also. "
+   "Does not work in batch mode. Disable with --disable-tee. "
+   "This option is disabled by default.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: Option deprecated; use --disable-tee instead.", 0, 0, 0, GET_NO_ARG,
-   NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. "
+   "WARNING: Option deprecated; use --disable-tee instead.",
+   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
-   (uchar**) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &current_user,
+   &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
-   (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
+   &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
-   (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
+   &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
    0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -1515,35 +1527,32 @@ static struct my_option my_long_options[
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"connect_timeout", OPT_CONNECT_TIMEOUT,
    "Number of seconds before connection timeout.",
-   (uchar**) &opt_connect_timeout,
-   (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
-   0, 0},
+   &opt_connect_timeout, &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG,
+   0, 0, 3600*12, 0, 0, 0},
   {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
    "The maximum packet length to send to or receive from server.",
-   (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
+   &opt_max_allowed_packet, &opt_max_allowed_packet, 0,
    GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
    (longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
    "The buffer size for TCP/IP and socket communication.",
-   (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
+   &opt_net_buffer_length, &opt_net_buffer_length, 0, GET_ULONG,
    REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"select_limit", OPT_SELECT_LIMIT,
    "Automatic limit for SELECT when using --safe-updates.",
-   (uchar**) &select_limit,
-   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
-   0, 1, 0},
+   &select_limit, &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L,
+   1, ULONG_MAX, 0, 1, 0},
   {"max_join_size", OPT_MAX_JOIN_SIZE,
    "Automatic limit for rows in a join when using --safe-updates.",
-   (uchar**) &max_join_size,
-   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
-   0, 1, 0},
+   &max_join_size, &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L,
+   1, ULONG_MAX, 0, 1, 0},
   {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
-    " uses old (pre-4.1.1) protocol.", (uchar**) &opt_secure_auth,
-    (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+    " uses old (pre-4.1.1) protocol.", &opt_secure_auth,
+    &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
-    (uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG, 
+    &show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
     0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2010-03-09 09:18:46 +0000
+++ b/client/mysql_upgrade.c	2010-06-08 19:16:36 +0000
@@ -68,7 +68,7 @@ static struct my_option my_long_options[
    "Directory for character set files.", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
-   (uchar**)&not_used, (uchar**)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &not_used, &not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"datadir", 'd',
    "Not used by mysql_upgrade. Only for backward compatibility.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -76,26 +76,26 @@ static struct my_option my_long_options[
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
    0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log.", (uchar* *) & default_dbug_option,
-   (uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
-   (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
+   &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
    "Set the default character set.", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
    "has already been executed for the current version of MySQL.",
-   (uchar**)&opt_force, (uchar**)&opt_force, 0,
+   &opt_force, &opt_force, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"host",'h', "Connect to host.", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given,"
-   " it's solicited on the tty.", (uchar**) &opt_password,(uchar**) &opt_password,
+   " it's solicited on the tty.", &opt_password,&opt_password,
    0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef __WIN__
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
@@ -121,15 +121,15 @@ static struct my_option my_long_options[
 #include <sslopt-longopts.h>
   {"tmpdir", 't', "Directory for temporary files.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
-   (uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &opt_user,
+   &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"verbose", 'v', "Display more output about the process.",
-   (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
+   &opt_verbose, &opt_verbose, 0,
    GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"write-binlog", OPT_WRITE_BINLOG,
    "All commands including mysqlcheck are binlogged. Enabled by default;"
    "use --skip-write-binlog when commands should not be sent to replication slaves.",
-   (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
+   &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysqladmin.cc'
--- a/client/mysqladmin.cc	2010-02-04 12:39:42 +0000
+++ b/client/mysqladmin.cc	2010-06-08 19:16:36 +0000
@@ -122,37 +122,37 @@ static struct my_option my_long_options[
 #endif
   {"count", 'c',
    "Number of iterations to make. This works with -i (--sleep) only.",
-   (uchar**) &nr_iterations, (uchar**) &nr_iterations, 0, GET_UINT,
+   &nr_iterations, &nr_iterations, 0, GET_UINT,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DBUG_OFF
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f',
    "Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.",
-   (uchar**) &option_force, (uchar**) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
+   &option_force, &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+  {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
-   (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
+  {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
+   &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's asked from the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -166,50 +166,52 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &tcp_port,
-   (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &tcp_port,
+   &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
     0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"relative", 'r',
-   "Show difference between current and previous values when used with -i. Currently only works with extended-status.",
-   (uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   "Show difference between current and previous values when used with -i. "
+   "Currently only works with extended-status.",
+   &opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
   0, 0, 0},
   {"set-variable", 'O',
-   "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
+   "Change the value of a variable. Please note that this option is "
+   "deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"silent", 's', "Silently exit if one can't connect to server.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &unix_port, &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"sleep", 'i', "Execute commands repeatedly with a sleep between.",
-   (uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
+   &interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
    0, 0},
 #include <sslopt-longopts.h>
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &user,
-   (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &user,
+   &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"verbose", 'v', "Write more information.", (uchar**) &opt_verbose,
-   (uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Write more information.", &opt_verbose,
+   &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"vertical", 'E',
    "Print output vertically. Is similar to --relative, but prints output vertically.",
-   (uchar**) &opt_vertical, (uchar**) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_vertical, &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
    OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout,
-   (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
+  {"connect_timeout", OPT_CONNECT_TIMEOUT, "", &opt_connect_timeout,
+   &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
    3600*12, 0, 1, 0},
-  {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
-   (uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
+  {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout,
+   &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
    SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2010-03-28 11:57:33 +0000
+++ b/client/mysqlbinlog.cc	2010-06-08 19:16:36 +0000
@@ -1004,9 +1004,8 @@ static struct my_option my_long_options[
    "events); 'always' prints base64 whenever possible. 'always' is for "
    "debugging only and should not be used in a production system. If this "
    "argument is not given, the default is 'auto'; if it is given with no "
-   "argument, 'always' is used."
-   ,(uchar**) &opt_base64_output_mode_str,
-   (uchar**) &opt_base64_output_mode_str,
+   "argument, 'always' is used.",
+   &opt_base64_output_mode_str, &opt_base64_output_mode_str,
    0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   /*
     mysqlbinlog needs charsets knowledge, to be able to convert a charset
@@ -1015,43 +1014,43 @@ static struct my_option my_long_options[
     SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
   */
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"database", 'd', "List entries for just this database (local log only).",
-   (uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
+   &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #ifndef DBUG_OFF
-  {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
     "enabled --to-last-log and are sending the output to the same MySQL server. "
     "This way you could avoid an endless loop. You would also like to use it "
     "when restoring after a crash to avoid duplication of the statements you "
     "already have. NOTE: you will need a SUPER privilege to use this option.",
-   (uchar**) &disable_log_bin, (uchar**) &disable_log_bin, 0, GET_BOOL,
+   &disable_log_bin, &disable_log_bin, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"force-if-open", 'F', "Force if binlog was not closed properly.",
-   (uchar**) &force_if_open_opt, (uchar**) &force_if_open_opt, 0, GET_BOOL, NO_ARG,
+   &force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"force-read", 'f', "Force reading unknown binlog events.",
-   (uchar**) &force_opt, (uchar**) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &force_opt, &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.",
-   (uchar**) &opt_hexdump, (uchar**) &opt_hexdump, 0, GET_BOOL, NO_ARG,
+   &opt_hexdump, &opt_hexdump, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Get the binlog from server.", (uchar**) &host, (uchar**) &host,
+  {"host", 'h', "Get the binlog from server.", &host, &host,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.",
-   (uchar**) &dirname_for_local_load, (uchar**) &dirname_for_local_load, 0,
+   &dirname_for_local_load, &dirname_for_local_load, 0,
    GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"offset", 'o', "Skip the first N entries.", (uchar**) &offset, (uchar**) &offset,
+  {"offset", 'o', "Skip the first N entries.", &offset, &offset,
    0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p', "Password to connect to remote server.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -1061,10 +1060,10 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
+   &port, &port, 0, GET_INT, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"position", OPT_POSITION, "Deprecated. Use --start-position instead.",
-   (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
+   &start_position, &start_position, 0, GET_ULL,
    REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
    /* COM_BINLOG_DUMP accepts only 4 bytes for the position */
    (ulonglong)(~(uint32)0), 0, 0, 0},
@@ -1072,31 +1071,31 @@ static struct my_option my_long_options[
    "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"read-from-remote-server", 'R', "Read binary logs from a MySQL server.",
-   (uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &remote_opt, &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-id", OPT_SERVER_ID,
    "Extract only binlog entries created by the server having the given id.",
-   (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG,
+   &server_id, &server_id, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"set-charset", OPT_SET_CHARSET,
-   "Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
-   (uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Add 'SET NAMES character_set' to the output.", &charset,
+   &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, 
-   (uchar**) &shared_memory_base_name, 
+   "Base name of shared memory.", &shared_memory_base_name,
+   &shared_memory_base_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"short-form", 's', "Just show regular queries: no extra info and no "
    "row-based events. This is for testing only, and should not be used in "
    "production systems. If you want to suppress base64-output, consider "
    "using --base64-output=never instead.",
-   (uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 
+   &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 
    0, 0},
   {"start-datetime", OPT_START_DATETIME,
    "Start reading the binlog at first event having a datetime equal or "
@@ -1104,12 +1103,12 @@ static struct my_option my_long_options[
    "in the local time zone, in any format accepted by the MySQL server "
    "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
    "(you should probably use quotes for your shell to set it properly).",
-   (uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
+   &start_datetime_str, &start_datetime_str,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"start-position", 'j',
    "Start reading the binlog at position N. Applies to the first binlog "
    "passed on the command line.",
-   (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
+   &start_position, &start_position, 0, GET_ULL,
    REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
    /* COM_BINLOG_DUMP accepts only 4 bytes for the position */
    (ulonglong)(~(uint32)0), 0, 0, 0},
@@ -1119,22 +1118,22 @@ static struct my_option my_long_options[
    "in the local time zone, in any format accepted by the MySQL server "
    "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
    "(you should probably use quotes for your shell to set it properly).",
-   (uchar**) &stop_datetime_str, (uchar**) &stop_datetime_str,
+   &stop_datetime_str, &stop_datetime_str,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"stop-position", OPT_STOP_POSITION,
    "Stop reading the binlog at position N. Applies to the last binlog "
    "passed on the command line.",
-   (uchar**) &stop_position, (uchar**) &stop_position, 0, GET_ULL,
+   &stop_position, &stop_position, 0, GET_ULL,
    REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
    (ulonglong)(~(my_off_t)0), 0, 0, 0},
   {"to-last-log", 't', "Requires -R. Will not stop at the end of the \
 requested binlog but rather continue printing until the end of the last \
 binlog of the MySQL server. If you send the output to the same MySQL server, \
 that may lead to an endless loop.",
-   (uchar**) &to_last_remote_log, (uchar**) &to_last_remote_log, 0, GET_BOOL,
+   &to_last_remote_log, &to_last_remote_log, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"user", 'u', "Connect to the remote server as username.",
-   (uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
+   &user, &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
    0, 0},
   {"verbose", 'v', "Reconstruct SQL statements out of row events. "
                    "-v -v adds comments on column data types.",
@@ -1143,7 +1142,7 @@ that may lead to an endless loop.",
    0, 0, 0, 0, 0},
   {"open_files_limit", OPT_OPEN_FILES_LIMIT,
    "Used to reserve file descriptors for use by this program.",
-   (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
+   &open_files_limit, &open_files_limit, 0, GET_ULONG,
    REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqlcheck.c	2010-06-08 19:16:36 +0000
@@ -54,13 +54,13 @@ static struct my_option my_long_options[
 {
   {"all-databases", 'A',
    "Check all the databases. This is the same as --databases with all databases selected.",
-   (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"all-in-1", '1',
    "Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
-   (uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
 #ifdef __NETWARE__
   {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
@@ -68,11 +68,11 @@ static struct my_option my_long_options[
 #endif
   {"auto-repair", OPT_AUTO_REPAIR,
    "If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
-   (uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
+   &opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
    0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"check-only-changed", 'C',
@@ -82,11 +82,11 @@ static struct my_option my_long_options[
    "Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"databases", 'B',
    "Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.",
-   (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
+   &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
@@ -96,40 +96,40 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fast",'F', "Check only tables that haven't been closed properly.",
-   (uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
-    (uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names,
+    &opt_fix_db_names, &opt_fix_db_names,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
-    (uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
+    &opt_fix_table_names, &opt_fix_table_names,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"extended", 'e',
    "If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
-   (uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host",'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"host",'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"medium-check", 'm',
    "Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"write-binlog", OPT_WRITE_BINLOG,
    "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
-   (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
+   &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
    0, 0},
@@ -146,38 +146,38 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"quick", 'q',
    "If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
-   (uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_quick, &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"repair", 'r',
    "Can fix almost anything except unique keys that aren't unique.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
-   (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"silent", 's', "Print only error messages.", &opt_silent,
+   &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
   {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"use-frm", OPT_FRM,
    "When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
-   (uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_frm, &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
-   (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &current_user,
+   &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqldump.c	2010-06-08 19:16:36 +0000
@@ -180,115 +180,115 @@ HASH ignore_table;
 static struct my_option my_long_options[] =
 {
   {"all", OPT_ALL, "Deprecated. Use --create-options instead.",
-   (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
+   &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
   {"all-databases", 'A',
    "Dump all the databases. This will be same as --databases with all databases selected.",
-   (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"all-tablespaces", 'Y',
    "Dump all the tablespaces.",
-   (uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_alltspcs, &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"no-tablespaces", 'y',
    "Do not dump any tablespace information.",
-   (uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_notspcs, &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.",
-   (uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_drop_database, &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.",
-   (uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+   &opt_drop, &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
    0},
   {"add-locks", OPT_LOCKS, "Add locks around INSERT statements.",
-   (uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+   &opt_lock, &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
    0},
   {"allow-keywords", OPT_KEYWORDS,
-   "Allow creation of column names that are keywords.", (uchar**) &opt_keywords,
-   (uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Allow creation of column names that are keywords.", &opt_keywords,
+   &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef __NETWARE__
   {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"comments", 'i', "Write additional information.",
-   (uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG,
+   &opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"compatible", OPT_COMPATIBLE,
    "Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.",
-   (uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
+   &opt_compatible_mode_str, &opt_compatible_mode_str, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"compact", OPT_COMPACT,
    "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs.  Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset.",
-   (uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_compact, &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"complete-insert", 'c', "Use complete insert statements.",
-   (uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL,
+   &opt_complete_insert, &opt_complete_insert, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"create-options", 'a',
    "Include all MySQL specific create options.",
-   (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
+   &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
   {"databases", 'B',
    "Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.",
-   (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
+   &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
    0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.",
-   (uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_delayed, &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"delete-master-logs", OPT_DELETE_MASTER_LOGS,
    "Delete logs on master after backup. This automatically enables --master-data.",
-   (uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0,
+   &opt_delete_master_logs, &opt_delete_master_logs, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"disable-keys", 'K',
-   "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys,
-   (uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+   "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", &opt_disable_keys,
+   &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"events", 'E', "Dump events.",
-     (uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
+     &opt_events, &opt_events, 0, GET_BOOL,
      NO_ARG, 0, 0, 0, 0, 0, 0},
   {"extended-insert", 'e',
    "Use multiple-row INSERT syntax that include several VALUES lists.",
-   (uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
+   &extended_insert, &extended_insert, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"fields-terminated-by", OPT_FTB,
    "Fields in the output file are terminated by the given string.", 
-   (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, 
+   &fields_terminated, &fields_terminated, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-enclosed-by", OPT_ENC,
    "Fields in the output file are enclosed by the given character.", 
-   (uchar**) &enclosed, (uchar**) &enclosed, 0, 
+   &enclosed, &enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
   {"fields-optionally-enclosed-by", OPT_O_ENC,
    "Fields in the output file are optionally enclosed by the given character.", 
-   (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, 
+   &opt_enclosed, &opt_enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
   {"fields-escaped-by", OPT_ESC, 
    "Fields in the output file are escaped by the given character.",
-   (uchar**) &escaped, (uchar**) &escaped, 0, 
+   &escaped, &escaped, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"first-slave", OPT_FIRST_SLAVE, "Deprecated, renamed to --lock-all-tables.",
-   (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
+   &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"flush-logs", 'F', "Flush logs file in server before starting dump. "
    "Note that if you dump many databases at once (using the option "
@@ -299,24 +299,24 @@ static struct my_option my_long_options[
    "to the moment all tables are locked. So if you want your dump and "
    "the log flush to happen at the same exact moment you should use "
    "--lock-all-tables or --master-data with --flush-logs.",
-   (uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &flush_logs, &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
    "after dumping the mysql database.  This option should be used any "
    "time the dump contains the mysql database and any other database "
    "that depends on the data in the mysql database for proper restore. ",
-   (uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &flush_privileges, &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
     "VARBINARY, BLOB) in hexadecimal format.",
-   (uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_hex_blob, &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"host", 'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore-table", OPT_IGNORE_TABLE,
    "Do not dump the specified table. To specify more than one table to ignore, "
    "use the directive multiple times, once for each table.  Each table must "
@@ -324,21 +324,21 @@ static struct my_option my_long_options[
    "--ignore-table=database.table.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
-   (uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"lines-terminated-by", OPT_LTB, 
    "Lines in the output file are terminated by the given string.",
-   (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
+   &lines_terminated, &lines_terminated, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"lock-all-tables", 'x', "Locks all tables across all databases. This "
    "is achieved by taking a global read lock for the duration of the whole "
    "dump. Automatically turns --single-transaction and --lock-tables off.",
-   (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
+   &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables,
-   (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"lock-tables", 'l', "Lock all tables for read.", &lock_tables,
+   &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
-   (uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR,
+   &log_error_file, &log_error_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"master-data", OPT_MASTER_DATA,
    "This causes the binary log position and filename to be appended to the "
@@ -350,33 +350,33 @@ static struct my_option my_long_options[
    "don't forget to read about --single-transaction below). In all cases, "
    "any action on logs will happen at the exact moment of the dump. "
    "Option automatically turns --lock-tables off.",
-   (uchar**) &opt_master_data, (uchar**) &opt_master_data, 0,
+   &opt_master_data, &opt_master_data, 0,
    GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
   {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, 
    "The maximum packet length to send to or receive from server.",
-    (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
+    &opt_max_allowed_packet, &opt_max_allowed_packet, 0,
     GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
    (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"net_buffer_length", OPT_NET_BUFFER_LENGTH, 
    "The buffer size for TCP/IP and socket communication.",
-    (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0,
+    &opt_net_buffer_length, &opt_net_buffer_length, 0,
     GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
    MALLOC_OVERHEAD-1024, 1024, 0},
   {"no-autocommit", OPT_AUTOCOMMIT,
    "Wrap tables with autocommit/commit statements.",
-   (uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
+   &opt_autocommit, &opt_autocommit, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"no-create-db", 'n',
    "Suppress the CREATE DATABASE ... IF EXISTS statement that normally is "
    "output for each dumped database if --all-databases or --databases is "
    "given.",
-   (uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, 
+   &opt_create_db, &opt_create_db, 0, 
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"no-create-info", 't', "Don't write table creation info.",
-   (uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL,
+   &opt_no_create_info, &opt_no_create_info, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
-   (uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-data", 'd', "No row information.", &opt_no_data,
+   &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"no-set-names", 'N',"Suppress the SET NAMES statement",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"opt", OPT_OPTIMIZE,
@@ -384,7 +384,7 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"order-by-primary", OPT_ORDER_BY_PRIMARY,
    "Sorts each table's rows by primary key, or first unique key, if such a key exists.  Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
-   (uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_order_by_primary, &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's solicited on the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -392,36 +392,36 @@ static struct my_option my_long_options[
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+  {"port", 'P', "Port number to use for connection.", &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
   {"protocol", OPT_MYSQL_PROTOCOL, 
    "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"quick", 'q', "Don't buffer query, dump directly to stdout.",
-   (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+   &quick, &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"quote-names",'Q', "Quote table and column names with backticks (`).",
-   (uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+   &opt_quoted, &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
    0, 0},
   {"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.",
-   (uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_replace_into, &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"result-file", 'r',
    "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"routines", 'R', "Dump stored routines (functions and procedures).",
-     (uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL,
+     &opt_routines, &opt_routines, 0, GET_BOOL,
      NO_ARG, 0, 0, 0, 0, 0, 0},
   {"set-charset", OPT_SET_CHARSET,
    "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.",
-   (uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
+   &opt_set_charset, &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
   {"set-variable", 'O',
    "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   /*
@@ -439,42 +439,42 @@ static struct my_option my_long_options[
    "connection should use the following statements: ALTER TABLE, DROP "
    "TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not "
    "isolated from them. Option automatically turns off --lock-tables.",
-   (uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0,
+   &opt_single_transaction, &opt_single_transaction, 0,
    GET_BOOL, NO_ARG,  0, 0, 0, 0, 0, 0},
   {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
-   (uchar**) &opt_dump_date, (uchar**) &opt_dump_date, 0,
+   &opt_dump_date, &opt_dump_date, 0,
    GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"skip-opt", OPT_SKIP_OPTIMIZATION,
    "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, 
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
   {"tab",'T',
    "Create tab-separated textfile for each table to given path. (Create .sql "
    "and .txt files.) NOTE: This only works if mysqldump is run on the same "
    "machine as the mysqld server.",
-   (uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &path, &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"tables", OPT_TABLES, "Overrides option --databases (-B).",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.",
-   (uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL,
+   &opt_dump_triggers, &opt_dump_triggers, 0, GET_BOOL,
    NO_ARG, 1, 0, 0, 0, 0, 0},
   {"tz-utc", OPT_TZ_UTC,
     "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
-    (uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+    &opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
   {"user", 'u', "User for login if not current user.",
-   (uchar**) &current_user, (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG,
+   &current_user, &current_user, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v', "Print info about the various stages.",
-   (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version",'V', "Output version information and exit.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"where", 'w', "Dump only selected records. Quotes are mandatory.",
-   (uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'client/mysqlimport.c'
--- a/client/mysqlimport.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqlimport.c	2010-06-08 19:16:36 +0000
@@ -73,68 +73,68 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"columns", 'c',
    "Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.",
-   (uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &opt_columns, &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
    GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete,
-   (uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"delete", 'd', "First delete all rows from table.", &opt_delete,
+   &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-terminated-by", OPT_FTB,
    "Fields in the input file are terminated by the given string.", 
-   (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, 
+   &fields_terminated, &fields_terminated, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-enclosed-by", OPT_ENC,
    "Fields in the import file are enclosed by the given character.", 
-   (uchar**) &enclosed, (uchar**) &enclosed, 0, 
+   &enclosed, &enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-optionally-enclosed-by", OPT_O_ENC,
    "Fields in the input file are optionally enclosed by the given character.", 
-   (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, 
+   &opt_enclosed, &opt_enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-escaped-by", OPT_ESC, 
    "Fields in the input file are escaped by the given character.",
-   (uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
+   &escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
    0, 0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"host", 'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore", 'i', "If duplicate unique key was found, keep old row.",
-   (uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &ignore, &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
-   (uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL,
+   &opt_ignore_lines, &opt_ignore_lines, 0, GET_LL,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"lines-terminated-by", OPT_LTB, 
    "Lines in the input file are terminated by the given string.",
-   (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
+   &lines_terminated, &lines_terminated, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file,
-   (uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"local", 'L', "Read all files through the client.", &opt_local_file,
+   &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"lock-tables", 'l', "Lock all tables for write (this disables threads).",
-    (uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 
+    &lock_tables, &lock_tables, 0, GET_BOOL, NO_ARG, 
     0, 0, 0, 0, 0, 0},
   {"low-priority", OPT_LOW_PRIORITY,
-   "Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority,
-   (uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Use LOW_PRIORITY when updating the table.", &opt_low_priority,
+   &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's asked from the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -148,35 +148,35 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replace", 'r', "If duplicate unique key was found, replace old row.",
-   (uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0,
+  {"silent", 's', "Be more silent.", &silent, &silent, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
   {"use-threads", OPT_USE_THREADS,
    "Load files in parallel. The argument is the number "
    "of threads to use for loading data.",
-   (uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0, 
+   &opt_use_threads, &opt_use_threads, 0, 
    GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
-   (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &current_user,
+   &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose,
-   (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Print info about the various stages.", &verbose,
+   &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'client/mysqlshow.c'
--- a/client/mysqlshow.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqlshow.c	2010-06-08 19:16:36 +0000
@@ -164,35 +164,35 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"character-sets-dir", 'c', "Directory for character set files.",
-   (uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
+   &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
    0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"count", OPT_COUNT,
    "Show number of rows per table (may be slow for non-MyISAM tables).",
-   (uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_count, &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+  {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"status", 'i', "Shows a lot of extra information about each table.",
-   (uchar**) &opt_status, (uchar**) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_status, &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
-  {"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys,
-   (uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"keys", 'k', "Show keys for table.", &opt_show_keys,
+   &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given, it's "
    "solicited on the tty.",
@@ -203,8 +203,8 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
 #ifdef __WIN__
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
@@ -215,19 +215,20 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
-   0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Base name of shared memory.", &shared_memory_base_name,
+   &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
+   0, 0, 0, 0, 0, 0},
 #endif
   {"show-table-type", 't', "Show table type column.",
-   (uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL,
+   &opt_table_type, &opt_table_type, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &user,
-   (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &user,
+   &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v',
    "More verbose output; you can use this multiple times to get even more "

=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqlslap.c	2010-06-08 19:16:36 +0000
@@ -511,62 +511,62 @@ static struct my_option my_long_options[
     0, 0, 0, 0, 0, 0},
   {"auto-generate-sql", 'a',
     "Generate SQL where not supplied by file or command line.",
-    (uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql,
+    &auto_generate_sql, &auto_generate_sql,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
     "Add an AUTO_INCREMENT column to auto-generated tables.",
-    (uchar**) &auto_generate_sql_autoincrement, 
-    (uchar**) &auto_generate_sql_autoincrement,
+    &auto_generate_sql_autoincrement,
+    &auto_generate_sql_autoincrement,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
     "Set this number to generate a set number of queries to run.",
-    (uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries,
+    &auto_actual_queries, &auto_actual_queries,
     0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
     "Add GUID based primary keys to auto-generated tables.",
-    (uchar**) &auto_generate_sql_guid_primary, 
-    (uchar**) &auto_generate_sql_guid_primary,
+    &auto_generate_sql_guid_primary,
+    &auto_generate_sql_guid_primary,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
     "Specify test load type: mixed, update, write, key, or read; default is mixed.",
-    (uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type,
+    &auto_generate_sql_type, &auto_generate_sql_type,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-secondary-indexes", 
     OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, 
     "Number of secondary indexes to add to auto-generated tables.",
-    (uchar**) &auto_generate_sql_secondary_indexes, 
-    (uchar**) &auto_generate_sql_secondary_indexes, 0,
+    &auto_generate_sql_secondary_indexes,
+    &auto_generate_sql_secondary_indexes, 0,
     GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-unique-query-number", 
     OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
     "Number of unique queries to generate for automatic tests.",
-    (uchar**) &auto_generate_sql_unique_query_number, 
-    (uchar**) &auto_generate_sql_unique_query_number,
+    &auto_generate_sql_unique_query_number,
+    &auto_generate_sql_unique_query_number,
     0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
   {"auto-generate-sql-unique-write-number", 
     OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
     "Number of unique queries to generate for auto-generate-sql-write-number.",
-    (uchar**) &auto_generate_sql_unique_write_number, 
-    (uchar**) &auto_generate_sql_unique_write_number,
+    &auto_generate_sql_unique_write_number,
+    &auto_generate_sql_unique_write_number,
     0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
   {"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
     "Number of row inserts to perform for each thread (default is 100).",
-    (uchar**) &auto_generate_sql_number, (uchar**) &auto_generate_sql_number,
+    &auto_generate_sql_number, &auto_generate_sql_number,
     0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
   {"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
-    (uchar**) &commit_rate, (uchar**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
+    &commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-    (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+    &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
     0, 0, 0},
   {"concurrency", 'c', "Number of clients to simulate for query to run.",
-    (uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR,
+    &concurrency_str, &concurrency_str, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
-    (uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG,
+    &create_string, &create_string, 0, GET_STR, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
-    (uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR, 
+    &create_schema_string, &create_schema_string, 0, GET_STR, 
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"csv", OPT_SLAP_CSV,
 	"Generate CSV output to named file or to stdout if no file is named.",
@@ -576,45 +576,45 @@ static struct my_option my_long_options[
    0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
-    (uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
+    &default_dbug_option, &default_dbug_option, 0, GET_STR,
     OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
-   (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
+   &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"delimiter", 'F',
     "Delimiter to use in SQL statements supplied in file or command line.",
-    (uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG,
+    &delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"detach", OPT_SLAP_DETACH,
     "Detach (close and reopen) connections after X number of requests.",
-    (uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG, 
+    &detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_ARG, 
     0, 0, 0, 0, 0, 0},
   {"engine", 'e', "Storage engine to use for creating the table.",
-    (uchar**) &default_engine, (uchar**) &default_engine, 0,
+    &default_engine, &default_engine, 0,
     GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+  {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations,
-    (uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
+  {"iterations", 'i', "Number of times to run the tests.", &iterations,
+    &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
   {"number-char-cols", 'x', 
     "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
-    (uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
+    &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"number-int-cols", 'y', 
     "Number of INT columns to create in table if specifying --auto-generate-sql.",
-    (uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, 
+    &num_int_cols_opt, &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, 
     0, 0, 0, 0, 0, 0},
   {"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY, 
     "Limit each client to this number of queries (this is not exact).",
-    (uchar**) &num_of_query, (uchar**) &num_of_query, 0,
+    &num_of_query, &num_of_query, 0,
     GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"only-print", OPT_MYSQL_ONLY_PRINT,
     "Do not connect to the databases, but instead print out what would have "
      "been done.",
-    (uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL,  NO_ARG,
+    &opt_only_print, &opt_only_print, 0, GET_BOOL,  NO_ARG,
     0, 0, 0, 0, 0, 0},
   {"password", 'p',
     "Password to use when connecting to server. If password is not given it's "
@@ -623,58 +623,54 @@ static struct my_option my_long_options[
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
     NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
-    (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
+  {"port", 'P', "Port number to use for connection.", &opt_mysql_port,
+    &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
     0},
   {"post-query", OPT_SLAP_POST_QUERY,
     "Query to run or file containing query to execute after tests have completed.",
-    (uchar**) &user_supplied_post_statements, 
-    (uchar**) &user_supplied_post_statements,
+    &user_supplied_post_statements, &user_supplied_post_statements,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"post-system", OPT_SLAP_POST_SYSTEM,
     "system() string to execute after tests have completed.",
-    (uchar**) &post_system, 
-    (uchar**) &post_system,
+    &post_system, &post_system,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"pre-query", OPT_SLAP_PRE_QUERY, 
     "Query to run or file containing query to execute before running tests.",
-    (uchar**) &user_supplied_pre_statements, 
-    (uchar**) &user_supplied_pre_statements,
+    &user_supplied_pre_statements, &user_supplied_pre_statements,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"pre-system", OPT_SLAP_PRE_SYSTEM, 
     "system() string to execute before running tests.",
-    (uchar**) &pre_system, 
-    (uchar**) &pre_system,
+    &pre_system, &pre_system,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"protocol", OPT_MYSQL_PROTOCOL,
     "The protocol to use for connection (tcp, socket, pipe, memory).",
     0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"query", 'q', "Query to run or file containing query to run.",
-    (uchar**) &user_supplied_query, (uchar**) &user_supplied_query,
+    &user_supplied_query, &user_supplied_query,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-    "Base name of shared memory.", (uchar**) &shared_memory_base_name,
-    (uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
+    "Base name of shared memory.", &shared_memory_base_name,
+    &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
 #endif
   {"silent", 's', "Run program in silent mode - no output.",
-    (uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL,  NO_ARG,
+    &opt_silent, &opt_silent, 0, GET_BOOL,  NO_ARG,
     0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-    (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+    &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &user,
-    (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &user,
+    &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v',
-    "More verbose output; you can use this multiple times to get even more "
-      "verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0, 
-      GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
-    NO_ARG, 0, 0, 0, 0, 0, 0},
+   "More verbose output; you can use this multiple times to get even more "
+   "verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG,
+   0, 0, 0, 0, 0, 0},
+  {"version", 'V', "Output version information and exit.", 0, 0, 0,
+   GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-03-08 14:30:20 +0000
+++ b/client/mysqltest.cc	2010-06-08 19:16:36 +0000
@@ -5836,18 +5836,18 @@ static struct my_option my_long_options[
 {
   {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
-   (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"basedir", 'b', "Basedir for tests.", &opt_basedir,
+   &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &opt_charsets_dir,
-   (uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &opt_charsets_dir,
+   &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use the compressed server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.",
-   (uchar**) &cursor_protocol, (uchar**) &cursor_protocol, 0,
+   &cursor_protocol, &cursor_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"database", 'D', "Database to use.", (uchar**) &opt_db, (uchar**) &opt_db, 0,
+  {"database", 'D', "Database to use.", &opt_db, &opt_db, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit",
@@ -5857,28 +5857,28 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0,
+  {"host", 'h', "Connect to host.", &opt_host, &opt_host, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include,
-   (uchar**) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir,
-   (uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"include", 'i', "Include SQL before each test case.", &opt_include,
+   &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir,
+   &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"mark-progress", OPT_MARK_PROGRESS,
    "Write line number and elapsed time to <testname>.progress.",
-   (uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0,
+   &opt_mark_progress, &opt_mark_progress, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
    "Maximum number of attempts to connect to server.",
-   (uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
+   &opt_max_connect_retries, &opt_max_connect_retries, 0,
    GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
   {"max-connections", OPT_MAX_CONNECTIONS,
    "Max number of open connections to server",
-   (uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0,
+   &opt_max_connections, &opt_max_connections, 0,
    GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
   {"password", 'p', "Password to use when connecting to server.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -5888,18 +5888,17 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_port,
-   (uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ps-protocol", OPT_PS_PROTOCOL, 
    "Use prepared-statement protocol for communication.",
-   (uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
+   &ps_protocol, &ps_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"quiet", 's', "Suppress all normal output.", (uchar**) &silent,
-   (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"quiet", 's', "Suppress all normal output.", &silent,
+   &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"record", 'r', "Record output of test_file into result file.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"result-file", 'R', "Read/store result from/in this file.",
-   (uchar**) &result_file_name, (uchar**) &result_file_name, 0,
+   &result_file_name, &result_file_name, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-arg", 'A', "Send option value to embedded server as a parameter.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5907,28 +5906,28 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, 
-   (uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 
+   "Base name of shared memory.", &shared_memory_base_name, 
+   &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 
    0, 0, 0},
 #endif
   {"silent", 's', "Suppress all normal output. Synonym for --quiet.",
-   (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
    "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"sleep", 'T', "Always sleep this many seconds on sleep commands.",
-   (uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
+   &opt_sleep, &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
    0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.",
-   (uchar**) &sp_protocol, (uchar**) &sp_protocol, 0,
+   &sp_protocol, &sp_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #include "sslopt-longopts.h"
   {"tail-lines", OPT_TAIL_LINES,
    "Number of lines of the result to include in a failure report.",
-   (uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0,
+   &opt_tail_lines, &opt_tail_lines, 0,
    GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
   {"test-file", 'x', "Read test from/in this file (default stdin).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5936,14 +5935,14 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"tmpdir", 't', "Temporary directory where sockets are put.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"user", 'u', "User for login.", (uchar**) &opt_user, (uchar**) &opt_user, 0,
+  {"user", 'u', "User for login.", &opt_user, &opt_user, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"verbose", 'v', "Write more.", (uchar**) &verbose, (uchar**) &verbose, 0,
+  {"verbose", 'v', "Write more.", &verbose, &verbose, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.",
-   (uchar**) &view_protocol, (uchar**) &view_protocol, 0,
+   &view_protocol, &view_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'extra/comp_err.c'
--- a/extra/comp_err.c	2010-02-26 13:16:46 +0000
+++ b/extra/comp_err.c	2010-06-08 19:16:36 +0000
@@ -99,31 +99,29 @@ static struct my_option my_long_options[
   {"debug", '#', "This is a non-debug version. Catch this and exit",
    0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log", (uchar**) & default_dbug_option,
-   (uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag,
-   (uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &info_flag,
+   &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"charset", 'C', "Charset dir", (uchar**) & charsets_dir,
-   (uchar**) & charsets_dir,
+  {"charset", 'C', "Charset dir", &charsets_dir, &charsets_dir,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE,
+  {"in_file", 'F', "Input file", &TXTFILE, &TXTFILE,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY,
-   (uchar**) & DATADIRECTORY,
+  {"out_dir", 'D', "Output base directory", &DATADIRECTORY, &DATADIRECTORY,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE,
-   (uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE,
-   (uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE,
-   (uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE,
-   (uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"out_file", 'O', "Output filename (errmsg.sys)", &OUTFILE,
+   &OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"header_file", 'H', "mysqld_error.h file ", &HEADERFILE,
+   &HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"name_file", 'N', "mysqld_ername.h file ", &NAMEFILE,
+   &NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"state_file", 'S', "sql_state.h file", &STATEFILE,
+   &STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 

=== modified file 'extra/my_print_defaults.c'
--- a/extra/my_print_defaults.c	2007-05-10 09:59:39 +0000
+++ b/extra/my_print_defaults.c	2010-06-08 19:16:36 +0000
@@ -46,31 +46,36 @@ static struct my_option my_long_options[
       searched for a file of this name (and standard filename extensions are
       added if the file has no extension)
   */
-  {"config-file", 'c', "Deprecated, please use --defaults-file instead.  Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added",
-   (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
+  {"config-file", 'c', "Deprecated, please use --defaults-file instead. "
+   "Name of config file to read; if no extension is given, default "
+   "extension (e.g., .ini or .cnf) will be added",
+   &config_file, &config_file, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit",
    0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option",
-   (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
+  {"defaults-file", 'c', "Like --config-file, except: if first option, "
+   "then read this file only, do not read global or per-user config "
+   "files; should be the first option",
+   &config_file, &config_file, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"defaults-extra-file", 'e',
-   "Read this file after the global config file and before the config file in the users home directory; should be the first option",
-   (uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0,
+   "Read this file after the global config file and before the config "
+   "file in the users home directory; should be the first option",
+   &my_defaults_extra_file, &my_defaults_extra_file, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"defaults-group-suffix", 'g',
    "In addition to the given groups, read also groups with this suffix",
-   (uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix,
+   &my_defaults_group_suffix, &my_defaults_group_suffix,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"extra-file", 'e',
    "Deprecated. Synonym for --defaults-extra-file.",
-   (uchar**) &my_defaults_extra_file,
-   (uchar**) &my_defaults_extra_file, 0, GET_STR,
+   &my_defaults_extra_file,
+   &my_defaults_extra_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"no-defaults", 'n', "Return an empty string (useful for scripts).",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'extra/mysql_waitpid.c'
--- a/extra/mysql_waitpid.c	2007-05-10 09:59:39 +0000
+++ b/extra/mysql_waitpid.c	2010-06-08 19:16:36 +0000
@@ -38,7 +38,7 @@ static struct my_option my_long_options[
    0, 0, 0, 0, 0},
   {"verbose", 'v',
    "Be more verbose. Give a warning, if kill can't handle signal 0.", 
-   (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Print version information and exit.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'extra/perror.c'
--- a/extra/perror.c	2009-07-24 06:45:06 +0000
+++ b/extra/perror.c	2010-06-08 19:16:36 +0000
@@ -60,18 +60,18 @@ static struct my_option my_long_options[
   {"info", 'I', "Synonym for --help.",  0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-  {"ndb", 257, "Ndbcluster storage engine specific error codes.",  (uchar**) &ndb_code,
-   (uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"ndb", 257, "Ndbcluster storage engine specific error codes.", &ndb_code,
+   &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 #ifdef HAVE_SYS_ERRLIST
   {"all", 'a', "Print all the error messages and the number.",
-   (uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG,
+   &print_all_codes, &print_all_codes, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
 #endif
   {"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose,
-   (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Print error code and message (default).", &verbose,
+   &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"version", 'V', "Displays version information and exits.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'extra/resolve_stack_dump.c'
--- a/extra/resolve_stack_dump.c	2008-12-19 10:47:28 +0000
+++ b/extra/resolve_stack_dump.c	2010-06-08 19:16:36 +0000
@@ -53,10 +53,10 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname,
-   (uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"symbols-file", 's', "Use specified symbols file.", &sym_fname,
+   &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"numeric-dump-file", 'n', "Read the dump from specified file.",
-   (uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG,
+   &dump_fname, &dump_fname, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'extra/resolveip.c'
--- a/extra/resolveip.c	2008-02-13 15:58:37 +0000
+++ b/extra/resolveip.c	2010-06-08 19:16:36 +0000
@@ -45,7 +45,7 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"info", 'I', "Synonym for --help.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent,
+  {"silent", 's', "Be more silent.", &silent, &silent,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Displays version information and exits.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'include/my_getopt.h'
--- a/include/my_getopt.h	2008-10-27 09:57:59 +0000
+++ b/include/my_getopt.h	2010-06-08 19:16:36 +0000
@@ -45,10 +45,10 @@ struct my_option
   const char *name;                     /* Name of the option */
   int        id;                        /* unique id or short option */
   const char *comment;                  /* option comment, for autom. --help */
-  uchar      **value;                   /* The variable value */
-  uchar      **u_max_value;             /* The user def. max variable value */
+  void       *value;                    /* The variable value */
+  void       *u_max_value;              /* The user def. max variable value */
   struct st_typelib *typelib;           /* Pointer to possible values */
-  ulong     var_type;
+  ulong      var_type;                  /* Must match the variable type */
   enum get_opt_arg_type arg_type;
   longlong   def_value;                 /* Default value */
   longlong   min_value;                 /* Min allowed value */
@@ -58,8 +58,16 @@ struct my_option
   void       *app_type;                 /* To be used by an application */
 };
 
-typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
-typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
+typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
+typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
+/**
+  Used to retrieve a reference to the object (variable) that holds the value
+  for the given option. For example, if var_type is GET_UINT, the function
+  must return a pointer to a variable of type uint. A argument is stored in
+  the location pointed to by the returned pointer.
+*/
+typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
+                                 int *);
 
 extern char *disabled_my_option;
 extern my_bool my_getopt_print_errors;
@@ -71,8 +79,7 @@ extern int handle_options (int *argc, ch
 extern void my_cleanup_options(const struct my_option *options);
 extern void my_print_help(const struct my_option *options);
 extern void my_print_variables(const struct my_option *options);
-extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
-                                        const struct my_option *, int *));
+extern void my_getopt_register_get_addr(my_getopt_value);
 
 ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
                                  my_bool *fix);

=== modified file 'include/sslopt-longopts.h'
--- a/include/sslopt-longopts.h	2007-05-10 09:59:39 +0000
+++ b/include/sslopt-longopts.h	2010-06-08 19:16:36 +0000
@@ -16,30 +16,31 @@
 #ifdef HAVE_OPENSSL
 
   {"ssl", OPT_SSL_SSL,
-   "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
- (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
-   0, 0, 0},
+   "Enable SSL for connection (automatically enabled with other flags)."
+   "Disable with --skip-ssl.", &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL,
+   NO_ARG, 0, 0, 0, 0, 0, 0},
   {"ssl-ca", OPT_SSL_CA,
    "CA file in PEM format (check OpenSSL docs, implies --ssl).",
-   (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-capath", OPT_SSL_CAPATH,
    "CA directory (check OpenSSL docs, implies --ssl).",
-   (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
-   (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
-   (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
-   (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #ifdef MYSQL_CLIENT
   {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
-   "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.",
-   (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert,
+   "Verify server's \"Common Name\" in its cert against hostname used "
+   "when connecting. This option is disabled by default.",
+   &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 #endif /* HAVE_OPENSSL */

=== modified file 'mysys/mf_wfile.c'
--- a/mysys/mf_wfile.c	2007-05-10 09:59:39 +0000
+++ b/mysys/mf_wfile.c	2010-06-08 19:16:36 +0000
@@ -119,6 +119,6 @@ void wf_end(WF_PACK *buffer)
 {
   DBUG_ENTER("wf_end");
   if (buffer)
-    my_free((uchar*) buffer,MYF(0));
+    my_free(buffer, MYF(0));
   DBUG_VOID_RETURN;
 } /* wf_end */

=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c	2010-01-21 08:10:05 +0000
+++ b/mysys/my_getopt.c	2010-06-08 19:16:36 +0000
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <m_string.h>
 
-typedef void (*init_func_p)(const struct my_option *option, uchar* *variable,
+typedef void (*init_func_p)(const struct my_option *option, void *variable,
                             longlong value);
 
 static void default_reporter(enum loglevel level, const char *format, ...);
@@ -40,11 +40,11 @@ static ulonglong getopt_ull(char *arg, c
 static double getopt_double(char *arg, const struct my_option *optp, int *err);
 static void init_variables(const struct my_option *options,
                            init_func_p init_one_value);
-static void init_one_value(const struct my_option *option, uchar* *variable,
+static void init_one_value(const struct my_option *option, void *variable,
 			   longlong value);
-static void fini_one_value(const struct my_option *option, uchar* *variable,
+static void fini_one_value(const struct my_option *option, void *variable,
 			   longlong value);
-static int setval(const struct my_option *opts, uchar* *value, char *argument,
+static int setval(const struct my_option *opts, void *value, char *argument,
 		  my_bool set_maximum_value);
 static char *check_struct_option(char *cur_arg, char *key_name);
 
@@ -101,10 +101,9 @@ static void default_reporter(enum loglev
   one. Call function 'get_one_option()' once for each option.
 */
 
-static uchar** (*getopt_get_addr)(const char *, uint, const struct my_option *, int *);
+static my_getopt_value getopt_get_addr;
 
-void my_getopt_register_get_addr(uchar** (*func_addr)(const char *, uint,
-						    const struct my_option *, int *))
+void my_getopt_register_get_addr(my_getopt_value func_addr)
 {
   getopt_get_addr= func_addr;
 }
@@ -119,7 +118,7 @@ int handle_options(int *argc, char ***ar
   char **pos, **pos_end, *optend, *UNINIT_VAR(prev_found),
        *opt_str, key_name[FN_REFLEN];
   const struct my_option *optp;
-  uchar* *value;
+  void *value;
   int error, i;
 
   LINT_INIT(opt_found);
@@ -173,7 +172,7 @@ int handle_options(int *argc, char ***ar
                                    "%s: Option '--set-variable' is deprecated. "
                                    "Use --variable-name=value instead.",
                                    my_progname);
-                                   
+
 	  must_be_var= 1;
 	  if (cur_arg[13] == '=')
 	  {
@@ -378,7 +377,7 @@ int handle_options(int *argc, char ***ar
           optp->value;
         if (error)
           return error;
-  
+
 	if (optp->arg_type == NO_ARG)
 	{
 	  if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL)
@@ -406,8 +405,8 @@ int handle_options(int *argc, char ***ar
 	    else
 	    {
 	      my_getopt_error_reporter(WARNING_LEVEL,
-				       "%s: ignoring option '--%s' due to \
-invalid value '%s'",
+				       "%s: ignoring option '--%s' due to "
+                                       "invalid value '%s'",
 				       my_progname, optp->name, optend);
 	      continue;
 	    }
@@ -611,15 +610,14 @@ static char *check_struct_option(char *c
   Will set the option value to given value
 */
 
-static int setval(const struct my_option *opts, uchar* *value, char *argument,
+static int setval(const struct my_option *opts, void *value, char *argument,
 		  my_bool set_maximum_value)
 {
   int err= 0;
 
   if (value && argument)
   {
-    uchar* *result_pos= ((set_maximum_value) ?
-		       opts->u_max_value : value);
+    void *result_pos= ((set_maximum_value) ? opts->u_max_value : value);
 
     if (!result_pos)
       return EXIT_NO_PTR_TO_VARIABLE;
@@ -994,7 +992,7 @@ static double getopt_double(char *arg, c
     value		Pointer to variable
 */
 
-static void init_one_value(const struct my_option *option, uchar* *variable,
+static void init_one_value(const struct my_option *option, void *variable,
 			   longlong value)
 {
   DBUG_ENTER("init_one_value");
@@ -1068,7 +1066,7 @@ static void init_one_value(const struct 
     value		Pointer to variable
 */
 
-static void fini_one_value(const struct my_option *option, uchar* *variable,
+static void fini_one_value(const struct my_option *option, void *variable,
 			   longlong value __attribute__ ((unused)))
 {
   DBUG_ENTER("fini_one_value");
@@ -1109,7 +1107,7 @@ static void init_variables(const struct 
   DBUG_ENTER("init_variables");
   for (; options->name; options++)
   {
-    uchar* *variable;
+    void *variable;
     DBUG_PRINT("options", ("name: '%s'", options->name));
     /*
       We must set u_max_value first as for some variables
@@ -1224,7 +1222,7 @@ void my_print_variables(const struct my_
   printf("--------------------------------- -----------------------------\n");
   for (optp= options; optp->id; optp++)
   {
-    uchar* *value= (optp->var_type & GET_ASK_ADDR ?
+    void *value= (optp->var_type & GET_ASK_ADDR ?
 		  (*getopt_get_addr)("", 0, optp, 0) : optp->value);
     if (value)
     {

=== modified file 'server-tools/instance-manager/options.cc'
--- a/server-tools/instance-manager/options.cc	2010-02-04 12:39:42 +0000
+++ b/server-tools/instance-manager/options.cc	2010-06-08 19:16:36 +0000
@@ -153,14 +153,14 @@ static struct my_option my_long_options[
 
 #ifndef __WIN__
   { "angel-pid-file", OPT_ANGEL_PID_FILE, "Pid file for angel process.",
-    (uchar* *) &Options::Daemon::angel_pid_file_name,
-    (uchar* *) &Options::Daemon::angel_pid_file_name,
+    &Options::Daemon::angel_pid_file_name,
+    &Options::Daemon::angel_pid_file_name,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 #endif
 
   { "bind-address", OPT_BIND_ADDRESS, "Bind address to use for connection.",
-    (uchar* *) &Options::Main::bind_address,
-    (uchar* *) &Options::Main::bind_address,
+    &Options::Main::bind_address,
+    &Options::Main::bind_address,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "check-password-file", OPT_CHECK_PASSWORD_FILE,
@@ -173,15 +173,15 @@ static struct my_option my_long_options[
 
 #ifndef DBUG_OFF
   {"debug", '#', "Debug log.",
-   (uchar* *) &Options::Debug::config_str,
-   (uchar* *) &Options::Debug::config_str,
+   &Options::Debug::config_str,
+   &Options::Debug::config_str,
    0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 
   { "default-mysqld-path", OPT_MYSQLD_PATH, "Where to look for MySQL"
     " Server binary.",
-    (uchar* *) &Options::Main::default_mysqld_path,
-    (uchar* *) &Options::Main::default_mysqld_path,
+    &Options::Main::default_mysqld_path,
+    &Options::Main::default_mysqld_path,
     0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "drop-user", OPT_DROP_USER,
@@ -194,8 +194,8 @@ static struct my_option my_long_options[
 
 #ifdef __WIN__
   { "install", OPT_INSTALL_SERVICE, "Install as system service.",
-    (uchar* *) &Options::Service::install_as_service,
-    (uchar* *) &Options::Service::install_as_service,
+    &Options::Service::install_as_service,
+    &Options::Service::install_as_service,
     0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
 #endif
 
@@ -205,22 +205,22 @@ static struct my_option my_long_options[
 
 #ifndef __WIN__
   { "log", OPT_LOG, "Path to log file. Used only with --run-as-service.",
-    (uchar* *) &Options::Daemon::log_file_name,
-    (uchar* *) &Options::Daemon::log_file_name,
+    &Options::Daemon::log_file_name,
+    &Options::Daemon::log_file_name,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 #endif
 
   { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor"
     " instances in seconds.",
-    (uchar* *) &Options::Main::monitoring_interval,
-    (uchar* *) &Options::Main::monitoring_interval,
+    &Options::Main::monitoring_interval,
+    &Options::Main::monitoring_interval,
     0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL,
     0, 0, 0, 0, 0 },
 
   { "mysqld-safe-compatible", OPT_MYSQLD_SAFE_COMPATIBLE,
     "Start Instance Manager in mysqld_safe-compatible manner.",
-    (uchar* *) &Options::Main::mysqld_safe_compatible,
-    (uchar* *) &Options::Main::mysqld_safe_compatible,
+    &Options::Main::mysqld_safe_compatible,
+    &Options::Main::mysqld_safe_compatible,
     0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
 
   { "print-password-line", OPT_PRINT_PASSWORD_LINE,
@@ -228,61 +228,61 @@ static struct my_option my_long_options[
     0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "password", OPT_PASSWORD, "Password to update the password file.",
-    (uchar* *) &Options::User_management::password,
-    (uchar* *) &Options::User_management::password,
+    &Options::User_management::password,
+    &Options::User_management::password,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "password-file", OPT_PASSWORD_FILE,
     "Look for Instance Manager users and passwords here.",
-    (uchar* *) &Options::Main::password_file_name,
-    (uchar* *) &Options::Main::password_file_name,
+    &Options::Main::password_file_name,
+    &Options::Main::password_file_name,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "pid-file", OPT_PID_FILE, "Pid file to use.",
-    (uchar* *) &Options::Main::pid_file_name,
-    (uchar* *) &Options::Main::pid_file_name,
+    &Options::Main::pid_file_name,
+    &Options::Main::pid_file_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "port", OPT_PORT, "Port number to use for connections.",
-    (uchar* *) &Options::Main::port_number,
-    (uchar* *) &Options::Main::port_number,
+    &Options::Main::port_number,
+    &Options::Main::port_number,
     0, GET_UINT, REQUIRED_ARG, DEFAULT_PORT, 0, 0, 0, 0, 0 },
 
 #ifdef __WIN__
   { "remove", OPT_REMOVE_SERVICE, "Remove system service.",
-    (uchar* *) &Options::Service::remove_service,
-    (uchar* *) &Options::Service::remove_service,
+    &Options::Service::remove_service,
+    &Options::Service::remove_service,
     0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0},
 #else
   { "run-as-service", OPT_RUN_AS_SERVICE,
     "Daemonize and start angel process.",
-    (uchar* *) &Options::Daemon::run_as_service,
+    &Options::Daemon::run_as_service,
     0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
 #endif
 
 #ifndef __WIN__
   { "socket", OPT_SOCKET, "Socket file to use for connection.",
-    (uchar* *) &Options::Main::socket_file_name,
-    (uchar* *) &Options::Main::socket_file_name,
+    &Options::Main::socket_file_name,
+    &Options::Main::socket_file_name,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 #endif
 
 #ifdef __WIN__
   { "standalone", OPT_STAND_ALONE, "Run the application in stand alone mode.",
-    (uchar* *) &Options::Service::stand_alone,
-    (uchar* *) &Options::Service::stand_alone,
+    &Options::Service::stand_alone,
+    &Options::Service::stand_alone,
     0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0},
 #else
   { "user", OPT_USER, "Username to start mysqlmanager.",
-    (uchar* *) &Options::Daemon::user,
-    (uchar* *) &Options::Daemon::user,
+    &Options::Daemon::user,
+    &Options::Daemon::user,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 #endif
 
   { "username", OPT_USERNAME,
     "Username to update the password file.",
-    (uchar* *) &Options::User_management::user_name,
-    (uchar* *) &Options::User_management::user_name,
+    &Options::User_management::user_name,
+    &Options::User_management::user_name,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
 
   { "version", 'V', "Output version information and exit.", 0, 0, 0,
@@ -290,8 +290,8 @@ static struct my_option my_long_options[
 
   { "wait-timeout", OPT_WAIT_TIMEOUT, "The number of seconds IM waits "
     "for activity on a connection before closing it.",
-    (uchar* *) &net_read_timeout,
-    (uchar* *) &net_read_timeout,
+    &net_read_timeout,
+    &net_read_timeout,
     0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0 },
 
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-06-04 14:10:22 +0000
+++ b/sql/mysqld.cc	2010-06-08 19:16:36 +0000
@@ -5787,12 +5787,12 @@ enum options_mysqld
 struct my_option my_long_options[] =
 {
   {"help", '?', "Display this help and exit.", 
-   (uchar**) &opt_help, (uchar**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_help, &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
 #ifdef HAVE_REPLICATION
   {"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
    "Option used by mysql-test for debugging and testing of replication.",
-   (uchar**) &abort_slave_event_count,  (uchar**) &abort_slave_event_count,
+   &abort_slave_event_count,  &abort_slave_event_count,
    0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif /* HAVE_REPLICATION */
   {"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS,
@@ -5800,33 +5800,34 @@ struct my_option my_long_options[] =
    "without corresponding xxx_init() or xxx_deinit(). That also means "
    "that one can load any function from any library, for example exit() "
    "from libc.so",
-   (uchar**) &opt_allow_suspicious_udfs, (uchar**) &opt_allow_suspicious_udfs,
+   &opt_allow_suspicious_udfs, &opt_allow_suspicious_udfs,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode will also set transaction isolation level 'serializable'.", 0, 0, 0,
+  {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode "
+   "will also set transaction isolation level 'serializable'.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-increment-increment", OPT_AUTO_INCREMENT,
    "Auto-increment columns are incremented by this.",
-   (uchar**) &global_system_variables.auto_increment_increment,
-   (uchar**) &max_system_variables.auto_increment_increment, 0, GET_ULONG,
+   &global_system_variables.auto_increment_increment,
+   &max_system_variables.auto_increment_increment, 0, GET_ULONG,
    OPT_ARG, 1, 1, 65535, 0, 1, 0 },
   {"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET,
    "Offset added to Auto-increment columns. Used when auto-increment-increment != 1.",
-   (uchar**) &global_system_variables.auto_increment_offset,
-   (uchar**) &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG,
+   &global_system_variables.auto_increment_offset,
+   &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG,
    1, 1, 65535, 0, 1, 0 },
   {"automatic-sp-privileges", OPT_SP_AUTOMATIC_PRIVILEGES,
    "Creating and dropping stored procedures alters ACLs. Disable with --skip-automatic-sp-privileges.",
-   (uchar**) &sp_automatic_privileges, (uchar**) &sp_automatic_privileges,
+   &sp_automatic_privileges, &sp_automatic_privileges,
    0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"basedir", 'b',
    "Path to installation directory. All paths are usually resolved relative to this.",
-   (uchar**) &mysql_home_ptr, (uchar**) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
+   &mysql_home_ptr, &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"big-tables", OPT_BIG_TABLES,
    "Allow big result sets by saving all temporary sets on file (solves most 'table full' errors).",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
-   (uchar**) &my_bind_addr_str, (uchar**) &my_bind_addr_str, 0, GET_STR,
+   &my_bind_addr_str, &my_bind_addr_str, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"binlog_format", OPT_BINLOG_FORMAT,
    "Does not have any effect without '--log-bin'. "
@@ -5839,10 +5840,11 @@ struct my_option my_long_options[] =
    "If ndbcluster is enabled and binlog_format is `mixed', the format switches"
    " to 'row' and back implicitly per each query accessing a NDB table."
 #endif
-   ,(uchar**) &opt_binlog_format, (uchar**) &opt_binlog_format,
+   , &opt_binlog_format, &opt_binlog_format,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"binlog-do-db", OPT_BINLOG_DO_DB,
-   "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
+   "Tells the master it should log updates for the specified database, "
+   "and exclude all others not explicitly mentioned.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB,
    "Tells the master that updates to the given database should not be logged to the binary log.",
@@ -5851,9 +5853,8 @@ struct my_option my_long_options[] =
    "The maximum size of a row-based binary log event in bytes. Rows will be "
    "grouped into events smaller than this size if possible. "
    "The value has to be a multiple of 256.",
-   (uchar**) &opt_binlog_rows_event_max_size, 
-   (uchar**) &opt_binlog_rows_event_max_size, 0, 
-   GET_ULONG, REQUIRED_ARG, 
+   &opt_binlog_rows_event_max_size, &opt_binlog_rows_event_max_size,
+   0, GET_ULONG, REQUIRED_ARG,
    /* def_value */ 1024, /* min_value */  256, /* max_value */ ULONG_MAX, 
    /* sub_size */     0, /* block_size */ 256, 
    /* app_type */ 0
@@ -5864,108 +5865,112 @@ struct my_option my_long_options[] =
 #endif
   {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
    "Don't ignore client side character set value sent during handshake.",
-   (uchar**) &opt_character_set_client_handshake,
-   (uchar**) &opt_character_set_client_handshake,
+   &opt_character_set_client_handshake,
+   &opt_character_set_client_handshake,
     0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM,
    "Set the filesystem character set.",
-   (uchar**) &character_set_filesystem_name,
-   (uchar**) &character_set_filesystem_name,
+   &character_set_filesystem_name,
+   &character_set_filesystem_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   {"character-set-server", 'C', "Set the default character set.",
-   (uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
+   &default_character_set_name, &default_character_set_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory where character sets are.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory where character sets are.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"chroot", 'r', "Chroot mysqld daemon during startup.",
-   (uchar**) &mysqld_chroot, (uchar**) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG,
+   &mysqld_chroot, &mysqld_chroot, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"collation-server", OPT_DEFAULT_COLLATION, "Set the default collation.",
-   (uchar**) &default_collation_name, (uchar**) &default_collation_name,
+   &default_collation_name, &default_collation_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   {"completion-type", OPT_COMPLETION_TYPE, "Default completion type.",
-   (uchar**) &global_system_variables.completion_type,
-   (uchar**) &max_system_variables.completion_type, 0, GET_ULONG,
+   &global_system_variables.completion_type,
+   &max_system_variables.completion_type, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, 2, 0, 1, 0},
   {"concurrent-insert", OPT_CONCURRENT_INSERT,
    "Use concurrent insert with MyISAM. Disable with --concurrent-insert=0.",
-   (uchar**) &myisam_concurrent_insert, (uchar**) &myisam_concurrent_insert,
+   &myisam_concurrent_insert, &myisam_concurrent_insert,
    0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
   {"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.",
-   (uchar**) &opt_console, (uchar**) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"datadir", 'h', "Path to the database root.", (uchar**) &mysql_data_home,
-   (uchar**) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"datadir", 'h', "Path to the database root.", &mysql_data_home,
+   &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DBUG_OFF
-  {"debug", '#', "Debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"default-character-set", OPT_DEFAULT_CHARACTER_SET_OLD, 
    "Set the default character set (deprecated option, use --character-set-server instead).",
-   (uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
+   &default_character_set_name, &default_character_set_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-  {"default-collation", OPT_DEFAULT_COLLATION_OLD, "Set the default collation (deprecated option, use --collation-server instead).",
-   (uchar**) &default_collation_name, (uchar**) &default_collation_name,
+  {"default-collation", OPT_DEFAULT_COLLATION_OLD, "Set the default collation "
+   "(deprecated option, use --collation-server instead).",
+   &default_collation_name, &default_collation_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   {"default-storage-engine", OPT_STORAGE_ENGINE,
    "Set the default storage engine (table type) for tables.",
-   (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str,
+   &default_storage_engine_str, &default_storage_engine_str,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-table-type", OPT_STORAGE_ENGINE,
    "(deprecated) Use --default-storage-engine.",
-   (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str,
+   &default_storage_engine_str, &default_storage_engine_str,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.",
-   (uchar**) &default_tz_name, (uchar**) &default_tz_name,
+   &default_tz_name, &default_tz_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.",
    0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL,
-   "Don't flush key buffers between writes for any MyISAM table. (Deprecated option, use --delay-key-write=all instead.)",
+   "Don't flush key buffers between writes for any MyISAM table. "
+   "(Deprecated option, use --delay-key-write=all instead.)",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_OPENSSL
   {"des-key-file", OPT_DES_KEY_FILE,
    "Load keys for des_encrypt() and des_encrypt from given file.",
-   (uchar**) &des_key_file, (uchar**) &des_key_file, 0, GET_STR, REQUIRED_ARG,
+   &des_key_file, &des_key_file, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #endif /* HAVE_OPENSSL */
 #ifdef HAVE_REPLICATION
   {"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
    "Option used by mysql-test for debugging and testing of replication.",
-   (uchar**) &disconnect_slave_event_count,
-   (uchar**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
-   0, 0, 0},
+   &disconnect_slave_event_count, &disconnect_slave_event_count,
+   0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif /* HAVE_REPLICATION */
   {"enable-locking", OPT_ENABLE_LOCK,
    "Deprecated option, use --external-locking instead.",
-   (uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
+   &opt_external_locking, &opt_external_locking,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef __NT__
   {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).",
-   (uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL,
+   &opt_enable_named_pipe, &opt_enable_named_pipe, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 #ifdef HAVE_STACK_TRACE_ON_SEGV
   {"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure.",
-   (uchar**) &opt_do_pstack, (uchar**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
+   &opt_do_pstack, &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
 #endif /* HAVE_STACK_TRACE_ON_SEGV */
   {"engine-condition-pushdown",
    OPT_ENGINE_CONDITION_PUSHDOWN,
    "Push supported query conditions to the storage engine.",
-   (uchar**) &global_system_variables.engine_condition_pushdown,
-   (uchar**) &global_system_variables.engine_condition_pushdown,
+   &global_system_variables.engine_condition_pushdown,
+   &global_system_variables.engine_condition_pushdown,
    0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   /* See how it's handled in get_one_option() */
   {"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.",
    NULL,  NULL, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"exit-info", 'T', "Used for debugging. Use at your own risk.", 0, 0, 0,
    GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"external-locking", OPT_USE_LOCKING, "Use system (external) locking (disabled by default).  With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.",
-   (uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
+  {"external-locking", OPT_USE_LOCKING, "Use system (external) locking "
+   "(disabled by default).  With this option enabled you can run myisamchk "
+   "to test (not repair) tables while the MySQL server is running. "
+   "Disable with --skip-external-locking.",
+   &opt_external_locking, &opt_external_locking,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -5973,64 +5978,61 @@ struct my_option my_long_options[] =
      easier to do */
   {"gdb", OPT_DEBUGGING,
    "Set up signals usable for debugging.",
-   (uchar**) &opt_debugging, (uchar**) &opt_debugging,
+   &opt_debugging, &opt_debugging,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"general_log", OPT_GENERAL_LOG,
-   "Enable/disable general log.", (uchar**) &opt_log,
-   (uchar**) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+   "Enable/disable general log.", &opt_log,
+   &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_LARGE_PAGES
-  {"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. \
-Disable with --skip-large-pages.",
-   (uchar**) &opt_large_pages, (uchar**) &opt_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0,
-   0, 0, 0},
+  {"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. "
+   "Disable with --skip-large-pages.", &opt_large_pages, &opt_large_pages,
+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"ignore-builtin-innodb", OPT_IGNORE_BUILTIN_INNODB ,
    "Disable initialization of builtin InnoDB plugin.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"init-connect", OPT_INIT_CONNECT, 
    "Command(s) that are executed for each new connection.",
-   (uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC,
+   &opt_init_connect, &opt_init_connect, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DISABLE_GRANT_OPTIONS
   {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.",
-   (uchar**) &opt_init_file, (uchar**) &opt_init_file, 0, GET_STR, REQUIRED_ARG,
+   &opt_init_file, &opt_init_file, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #endif
   {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed by a slave server \
 each time the SQL thread starts.",
-   (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC,
+   &opt_init_slave, &opt_init_slave, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"language", 'L',
    "Client error messages in given language. May be given as a full path.",
-   (uchar**) &language_ptr, (uchar**) &language_ptr, 0, GET_STR, REQUIRED_ARG,
+   &language_ptr, &language_ptr, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"lc-time-names", OPT_LC_TIME_NAMES,
    "Set the language used for the month names and the days of the week.",
-   (uchar**) &lc_time_names_name,
-   (uchar**) &lc_time_names_name,
+   &lc_time_names_name, &lc_time_names_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   {"local-infile", OPT_LOCAL_INFILE,
    "Enable/disable LOAD DATA LOCAL INFILE (takes values 1 or 0).",
-   (uchar**) &opt_local_infile,
-   (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
+   &opt_local_infile, &opt_local_infile, 0, GET_BOOL, OPT_ARG,
    1, 0, 0, 0, 0, 0},
   {"log", 'l', "Log connections and queries to file (deprecated option, use "
-   "--general_log/--general_log_file instead).", (uchar**) &opt_logname,
-   (uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+   "--general_log/--general_log_file instead).", &opt_logname,
+   &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"general_log_file", OPT_GENERAL_LOG_FILE,
-   "Log connections and queries to given file.", (uchar**) &opt_logname,
-   (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Log connections and queries to given file.", &opt_logname,
+   &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"log-bin", OPT_BIN_LOG,
    "Log update queries in binary format. Optional (but strongly recommended "
    "to avoid replication problems if server's hostname changes) argument "
    "should be the chosen location for the binary log files.",
-   (uchar**) &opt_bin_logname, (uchar**) &opt_bin_logname, 0, GET_STR_ALLOC,
+   &opt_bin_logname, &opt_bin_logname, 0, GET_STR_ALLOC,
    OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"log-bin-index", OPT_BIN_LOG_INDEX,
    "File that holds the names for last binary log files.",
-   (uchar**) &opt_binlog_index_name, (uchar**) &opt_binlog_index_name, 0, GET_STR,
+   &opt_binlog_index_name, &opt_binlog_index_name, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef TO_BE_REMOVED_IN_5_1_OR_6_0
   /*
@@ -6041,7 +6043,7 @@ each time the SQL thread starts.",
   */
   {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS_OLD,
    "(deprecated) Use log-bin-trust-function-creators.",
-   (uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0,
+   &trust_function_creators, &trust_function_creators, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   /*
@@ -6056,188 +6058,195 @@ each time the SQL thread starts.",
    "Note that if ALL connections to this server ALWAYS use row-based binary "
    "logging, the security issues do not exist and the binary logging cannot "
    "break, so you can safely set this to 1."
-   ,(uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0,
+   ,&trust_function_creators, &trust_function_creators, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"log-error", OPT_ERROR_LOG_FILE, "Error log file.",
-   (uchar**) &log_error_file_ptr, (uchar**) &log_error_file_ptr, 0, GET_STR,
+   &log_error_file_ptr, &log_error_file_ptr, 0, GET_STR,
    OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.",
-   (uchar**) &myisam_log_filename, (uchar**) &myisam_log_filename, 0, GET_STR,
+   &myisam_log_filename, &myisam_log_filename, 0, GET_STR,
    OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"log-long-format", '0',
-   "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", 
+   "Log some extra information to update log. Please note that this option "
+   "is deprecated; see --log-short-format option.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef WITH_CSV_STORAGE_ENGINE
   {"log-output", OPT_LOG_OUTPUT,
    "Syntax: log-output[=value[,value...]], where \"value\" could be TABLE, "
    "FILE or NONE.",
-   (uchar**) &log_output_str, (uchar**) &log_output_str, 0,
+   &log_output_str, &log_output_str, 0,
    GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES,
    "Log queries that are executed without benefit of any index to the slow log if it is open.",
-   (uchar**) &opt_log_queries_not_using_indexes, (uchar**) &opt_log_queries_not_using_indexes,
+   &opt_log_queries_not_using_indexes, &opt_log_queries_not_using_indexes,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"log-short-format", OPT_SHORT_LOG_FORMAT,
    "Don't log extra information to update and slow-query logs.",
-   (uchar**) &opt_short_log_format, (uchar**) &opt_short_log_format,
+   &opt_short_log_format, &opt_short_log_format,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"log-slave-updates", OPT_LOG_SLAVE_UPDATES,
-   "Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.",
-   (uchar**) &opt_log_slave_updates, (uchar**) &opt_log_slave_updates, 0, GET_BOOL,
+   "Tells the slave to log the updates from the slave thread to the binary log. "
+   "You will need to turn it on if you plan to daisy-chain the slaves.",
+   &opt_log_slave_updates, &opt_log_slave_updates, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"log-slow-admin-statements", OPT_LOG_SLOW_ADMIN_STATEMENTS,
-   "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.",
-   (uchar**) &opt_log_slow_admin_statements,
-   (uchar**) &opt_log_slow_admin_statements,
-   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements "
+   "to the slow log if it is open.", &opt_log_slow_admin_statements,
+   &opt_log_slow_admin_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
  {"log-slow-slave-statements", OPT_LOG_SLOW_SLAVE_STATEMENTS,
   "Log slow statements executed by slave thread to the slow log if it is open.",
-  (uchar**) &opt_log_slow_slave_statements,
-  (uchar**) &opt_log_slow_slave_statements,
+  &opt_log_slow_slave_statements,
+  &opt_log_slow_slave_statements,
   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"log_slow_queries", OPT_SLOW_QUERY_LOG,
     "Log slow queries to a table or log file. Defaults logging to table "
     "mysql.slow_log or hostname-slow.log if --log-output=file is used. "
     "Must be enabled to activate other slow log options. "
     "(deprecated option, use --slow_query_log/--slow_query_log_file instead)",
-   (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG,
+   &opt_slow_logname, &opt_slow_logname, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
   {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE,
-    "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.",
-   (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR,
+    "Log slow queries to given log file. Defaults logging to hostname-slow.log. "
+    "Must be enabled to activate other slow log options.",
+   &opt_slow_logname, &opt_slow_logname, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"log-tc", OPT_LOG_TC,
    "Path to transaction coordinator log (used for transactions that affect "
    "more than one storage engine, when binary log is disabled).",
-   (uchar**) &opt_tc_log_file, (uchar**) &opt_tc_log_file, 0, GET_STR,
+   &opt_tc_log_file, &opt_tc_log_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_MMAP
   {"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.",
-   (uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG,
+   &opt_tc_log_size, &opt_tc_log_size, 0, GET_ULONG,
    REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0,
    TC_LOG_PAGE_SIZE, 0},
 #endif
   {"log-update", OPT_UPDATE_LOG,
    "The update log is deprecated since version 5.0, is replaced by the binary "
    "log and this option just turns on --log-bin instead.",
-   (uchar**) &opt_update_logname, (uchar**) &opt_update_logname, 0, GET_STR,
+   &opt_update_logname, &opt_update_logname, 0, GET_STR,
    OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"log-warnings", 'W', "Log some not critical warnings to the log file.",
-   (uchar**) &global_system_variables.log_warnings,
-   (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
+   &global_system_variables.log_warnings,
+   &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
    0, 0, 0},
   {"low-priority-updates", OPT_LOW_PRIORITY_UPDATES,
    "INSERT/DELETE/UPDATE has lower priority than selects.",
-   (uchar**) &global_system_variables.low_priority_updates,
-   (uchar**) &max_system_variables.low_priority_updates,
+   &global_system_variables.low_priority_updates,
+   &max_system_variables.low_priority_updates,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"master-connect-retry", OPT_MASTER_CONNECT_RETRY,
    "The number of seconds the slave thread will sleep before retrying to "
    "connect to the master, in case the master goes down or the connection "
    "is lost.",
-   (uchar**) &master_connect_retry, (uchar**) &master_connect_retry, 0, GET_UINT,
+   &master_connect_retry, &master_connect_retry, 0, GET_UINT,
    REQUIRED_ARG, 60, 0, 0, 0, 0, 0},
   {"master-host", OPT_MASTER_HOST,
-   "Master hostname or IP address for replication. If not set, the slave thread will not be started. Note that the setting of master-host will be ignored if there exists a valid master.info file.",
-   (uchar**) &master_host, (uchar**) &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
+   "Master hostname or IP address for replication. If not set, the slave "
+   "thread will not be started. Note that the setting of master-host will "
+   "be ignored if there exists a valid master.info file.",
+   &master_host, &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
    0, 0, 0, 0},
   {"master-info-file", OPT_MASTER_INFO_FILE,
-   "The location and name of the file that remembers the master and where the I/O replication \
-thread is in the master's binlogs.",
-   (uchar**) &master_info_file, (uchar**) &master_info_file, 0, GET_STR,
+   "The location and name of the file that remembers the master and where "
+   "the I/O replication thread is in the master's binlogs.",
+   &master_info_file, &master_info_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"master-password", OPT_MASTER_PASSWORD,
    "The password the slave thread will authenticate with when connecting to "
    "the master. If not set, an empty password is assumed. The value in "
    "master.info will take precedence if it can be read.",
-   (uchar**)&master_password, (uchar**)&master_password, 0,
+   &master_password, &master_password, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"master-port", OPT_MASTER_PORT,
-   "The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read.",
-   (uchar**) &master_port, (uchar**) &master_port, 0, GET_UINT, REQUIRED_ARG,
+   "The port the master is listening on. If not set, the compiled setting of "
+   "MYSQL_PORT is assumed. If you have not tinkered with configure options, "
+   "this should be 3306. The value in master.info will take precedence if it "
+   "can be read.", &master_port, &master_port, 0, GET_UINT, REQUIRED_ARG,
    MYSQL_PORT, 0, 0, 0, 0, 0},
   {"master-retry-count", OPT_MASTER_RETRY_COUNT,
    "The number of tries the slave will make to connect to the master before giving up.",
-   (uchar**) &master_retry_count, (uchar**) &master_retry_count, 0, GET_ULONG,
+   &master_retry_count, &master_retry_count, 0, GET_ULONG,
    REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
   {"master-ssl", OPT_MASTER_SSL,
    "Enable the slave to connect to the master using SSL.",
-   (uchar**) &master_ssl, (uchar**) &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &master_ssl, &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"master-ssl-ca", OPT_MASTER_SSL_CA,
    "Master SSL CA file. Only applies if you have enabled master-ssl.",
-   (uchar**) &master_ssl_ca, (uchar**) &master_ssl_ca, 0, GET_STR, OPT_ARG,
+   &master_ssl_ca, &master_ssl_ca, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
   {"master-ssl-capath", OPT_MASTER_SSL_CAPATH,
    "Master SSL CA path. Only applies if you have enabled master-ssl.",
-   (uchar**) &master_ssl_capath, (uchar**) &master_ssl_capath, 0, GET_STR, OPT_ARG,
+   &master_ssl_capath, &master_ssl_capath, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
   {"master-ssl-cert", OPT_MASTER_SSL_CERT,
    "Master SSL certificate file name. Only applies if you have enabled "
    "master-ssl.",
-   (uchar**) &master_ssl_cert, (uchar**) &master_ssl_cert, 0, GET_STR, OPT_ARG,
+   &master_ssl_cert, &master_ssl_cert, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
   {"master-ssl-cipher", OPT_MASTER_SSL_CIPHER,
    "Master SSL cipher. Only applies if you have enabled master-ssl.",
-   (uchar**) &master_ssl_cipher, (uchar**) &master_ssl_capath, 0, GET_STR, OPT_ARG,
+   &master_ssl_cipher, &master_ssl_capath, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
   {"master-ssl-key", OPT_MASTER_SSL_KEY,
    "Master SSL keyfile name. Only applies if you have enabled master-ssl.",
-   (uchar**) &master_ssl_key, (uchar**) &master_ssl_key, 0, GET_STR, OPT_ARG,
+   &master_ssl_key, &master_ssl_key, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
   {"master-user", OPT_MASTER_USER,
-   "The username the slave thread will use for authentication when connecting to the master. The user must have FILE privilege. If the master user is not set, user test is assumed. The value in master.info will take precedence if it can be read.",
-   (uchar**) &master_user, (uchar**) &master_user, 0, GET_STR, REQUIRED_ARG, 0, 0,
+   "The username the slave thread will use for authentication when "
+   "connecting to the master. The user must have FILE privilege. "
+   "If the master user is not set, user test is assumed. The value "
+   "in master.info will take precedence if it can be read.",
+   &master_user, &master_user, 0, GET_STR, REQUIRED_ARG, 0, 0,
    0, 0, 0, 0},
 #ifdef HAVE_REPLICATION
   {"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS,
    "Option used by mysql-test for debugging and testing of replication.",
-   (uchar**) &max_binlog_dump_events, (uchar**) &max_binlog_dump_events, 0,
+   &max_binlog_dump_events, &max_binlog_dump_events, 0,
    GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif /* HAVE_REPLICATION */
-  {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (uchar**) &locked_in_memory,
-   (uchar**) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", &locked_in_memory,
+   &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"myisam-recover", OPT_MYISAM_RECOVER,
    "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
-   (uchar**) &myisam_recover_options_str, (uchar**) &myisam_recover_options_str, 0,
+   &myisam_recover_options_str, &myisam_recover_options_str, 0,
    GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
   {"ndb-connectstring", OPT_NDB_CONNECTSTRING,
    "Connect string for ndbcluster.",
-   (uchar**) &opt_ndb_connectstring,
-   (uchar**) &opt_ndb_connectstring,
+   &opt_ndb_connectstring, &opt_ndb_connectstring,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ndb-mgmd-host", OPT_NDB_MGMD,
    "Set host and port for ndb_mgmd. Syntax: hostname[:port]",
-   (uchar**) &opt_ndb_mgmd,
-   (uchar**) &opt_ndb_mgmd,
+   &opt_ndb_mgmd, &opt_ndb_mgmd,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ndb-nodeid", OPT_NDB_NODEID,
    "Nodeid for this mysqlserver in the cluster.",
-   (uchar**) &opt_ndb_nodeid,
-   (uchar**) &opt_ndb_nodeid,
+   &opt_ndb_nodeid,
+   &opt_ndb_nodeid,
    0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
    "Specify number of autoincrement values that are prefetched.",
-   (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz,
-   (uchar**) &max_system_variables.ndb_autoincrement_prefetch_sz,
+   &global_system_variables.ndb_autoincrement_prefetch_sz,
+   &max_system_variables.ndb_autoincrement_prefetch_sz,
    0, GET_ULONG, REQUIRED_ARG, 1, 1, 256, 0, 0, 0},
   {"ndb-force-send", OPT_NDB_FORCE_SEND,
    "Force send of buffers to ndb immediately without waiting for "
    "other threads.",
-   (uchar**) &global_system_variables.ndb_force_send,
-   (uchar**) &global_system_variables.ndb_force_send,
+   &global_system_variables.ndb_force_send,
+   &global_system_variables.ndb_force_send,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   {"ndb_force_send", OPT_NDB_FORCE_SEND,
    "same as --ndb-force-send.",
-   (uchar**) &global_system_variables.ndb_force_send,
-   (uchar**) &global_system_variables.ndb_force_send,
+   &global_system_variables.ndb_force_send,
+   &global_system_variables.ndb_force_send,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   {"ndb-extra-logging", OPT_NDB_EXTRA_LOGGING,
    "Turn on more logging in the error log.",
-   (uchar**) &ndb_extra_logging,
-   (uchar**) &ndb_extra_logging,
+   &ndb_extra_logging,
+   &ndb_extra_logging,
    0, GET_INT, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_NDB_BINLOG
   {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
@@ -6245,86 +6254,87 @@ thread is in the master's binlogs.",
    "E.g., 3 means that if the difference between what epoch has been received "
    "from the storage nodes and what has been applied to the binlog is 3 or more, "
    "a status message will be sent to the cluster log.",
-   (uchar**) &ndb_report_thresh_binlog_epoch_slip,
-   (uchar**) &ndb_report_thresh_binlog_epoch_slip,
+   &ndb_report_thresh_binlog_epoch_slip,
+   &ndb_report_thresh_binlog_epoch_slip,
    0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0},
   {"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
    "Threshold on percentage of free memory before reporting binlog status. E.g., "
    "10 means that if amount of available memory for receiving binlog data from "
    "the storage nodes goes below 10%, "
    "a status message will be sent to the cluster log.",
-   (uchar**) &ndb_report_thresh_binlog_mem_usage,
-   (uchar**) &ndb_report_thresh_binlog_mem_usage,
+   &ndb_report_thresh_binlog_mem_usage,
+   &ndb_report_thresh_binlog_mem_usage,
    0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0},
 #endif
   {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
    "Use exact records count during query planning and for fast "
    "select count(*), disable for faster queries.",
-   (uchar**) &global_system_variables.ndb_use_exact_count,
-   (uchar**) &global_system_variables.ndb_use_exact_count,
+   &global_system_variables.ndb_use_exact_count,
+   &global_system_variables.ndb_use_exact_count,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT,
    "Same as --ndb-use-exact-count.",
-   (uchar**) &global_system_variables.ndb_use_exact_count,
-   (uchar**) &global_system_variables.ndb_use_exact_count,
+   &global_system_variables.ndb_use_exact_count,
+   &global_system_variables.ndb_use_exact_count,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   {"ndb-use-transactions", OPT_NDB_USE_TRANSACTIONS,
    "Use transactions for large inserts, if enabled then large "
    "inserts will be split into several smaller transactions",
-   (uchar**) &global_system_variables.ndb_use_transactions,
-   (uchar**) &global_system_variables.ndb_use_transactions,
+   &global_system_variables.ndb_use_transactions,
+   &global_system_variables.ndb_use_transactions,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS,
    "Same as --ndb-use-transactions.",
-   (uchar**) &global_system_variables.ndb_use_transactions,
-   (uchar**) &global_system_variables.ndb_use_transactions,
+   &global_system_variables.ndb_use_transactions,
+   &global_system_variables.ndb_use_transactions,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   {"ndb-shm", OPT_NDB_SHM,
    "Use shared memory connections when available.",
-   (uchar**) &opt_ndb_shm,
-   (uchar**) &opt_ndb_shm,
+   &opt_ndb_shm, &opt_ndb_shm,
    0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0},
   {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,
    "Select nodes for transactions in a more optimal way.",
-   (uchar**) &opt_ndb_optimized_node_selection,
-   (uchar**) &opt_ndb_optimized_node_selection,
+   &opt_ndb_optimized_node_selection,
+   &opt_ndb_optimized_node_selection,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
   { "ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME,
     "A dedicated thread is created to, at the given milliseconds interval, "
     "invalidate the query cache if another MySQL server in the cluster has "
     "changed the data in the database.",
-    (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
+    &opt_ndb_cache_check_time, &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
     0, 0, LONG_TIMEOUT, 0, 1, 0},
   {"ndb-index-stat-enable", OPT_NDB_INDEX_STAT_ENABLE,
    "Use ndb index statistics in query optimization.",
-   (uchar**) &global_system_variables.ndb_index_stat_enable,
-   (uchar**) &max_system_variables.ndb_index_stat_enable,
+   &global_system_variables.ndb_index_stat_enable,
+   &max_system_variables.ndb_index_stat_enable,
    0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0},
 #endif
   {"ndb-use-copying-alter-table",
    OPT_NDB_USE_COPYING_ALTER_TABLE,
-   "Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails).",
-   (uchar**) &global_system_variables.ndb_use_copying_alter_table,
-   (uchar**) &global_system_variables.ndb_use_copying_alter_table,
+   "Force ndbcluster to always copy tables at alter table "
+   "(should only be used if on-line alter table fails).",
+   &global_system_variables.ndb_use_copying_alter_table,
+   &global_system_variables.ndb_use_copying_alter_table,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},  
   {"new", 'n', "Use very new, possibly 'unsafe', functions.",
-   (uchar**) &global_system_variables.new_mode,
-   (uchar**) &max_system_variables.new_mode,
+   &global_system_variables.new_mode,
+   &max_system_variables.new_mode,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef NOT_YET
   {"no-mix-table-types", OPT_NO_MIX_TYPE, 
    "Don't allow commands that use two different table types.",
-   (uchar**) &opt_no_mix_types, (uchar**) &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
+   &opt_no_mix_types, &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
 #endif
   {"old-alter-table", OPT_OLD_ALTER_TABLE,
    "Use old, non-optimized alter table.",
-   (uchar**) &global_system_variables.old_alter_table,
-   (uchar**) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG,
+   &global_system_variables.old_alter_table,
+   &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients).",
-   (uchar**) &global_system_variables.old_passwords,
-   (uchar**) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG,
+  {"old-passwords", OPT_OLD_PASSWORDS, "Use old password "
+   "encryption method (needed for 4.0 and older clients).",
+   &global_system_variables.old_passwords,
+   &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"one-thread", OPT_ONE_THREAD,
    "(Deprecated): Only use one thread (for debugging under Linux). Use "
@@ -6333,10 +6343,10 @@ thread is in the master's binlogs.",
   {"old-style-user-limits", OPT_OLD_STYLE_USER_LIMITS,
    "Enable old-style user limits (before 5.0.3, user resources were counted "
    "per each user+host vs. per account).",
-   (uchar**) &opt_old_style_user_limits, (uchar**) &opt_old_style_user_limits,
+   &opt_old_style_user_limits, &opt_old_style_user_limits,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
-   (uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR,
+   &pidfile_name_ptr, &pidfile_name_ptr, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"port", 'P', "Port number to use for connection or 0 for default to, in "
    "order of preference, my.cnf, $MYSQL_TCP_PORT, "
@@ -6344,64 +6354,85 @@ thread is in the master's binlogs.",
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &mysqld_port,
-   (uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &mysqld_port,
+   &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"port-open-timeout", OPT_PORT_OPEN_TIMEOUT,
    "Maximum time in seconds to wait for the port to become free. "
-   "(Default: No wait).", (uchar**) &mysqld_port_timeout,
-   (uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "(Default: No wait).", &mysqld_port_timeout,
+   &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
   {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory.",
-   (uchar**) &global_system_variables.profiling_history_size,
-   (uchar**) &max_system_variables.profiling_history_size,
+   &global_system_variables.profiling_history_size,
+   &max_system_variables.profiling_history_size,
    0, GET_ULONG, REQUIRED_ARG, 15, 0, 100, 0, 0, 0},
 #endif
   {"relay-log", OPT_RELAY_LOG,
    "The location and name to use for relay logs.",
-   (uchar**) &opt_relay_logname, (uchar**) &opt_relay_logname, 0,
+   &opt_relay_logname, &opt_relay_logname, 0,
    GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"relay-log-index", OPT_RELAY_LOG_INDEX,
    "The location and name to use for the file that keeps a list of the last \
 relay logs.",
-   (uchar**) &opt_relaylog_index_name, (uchar**) &opt_relaylog_index_name, 0,
+   &opt_relaylog_index_name, &opt_relaylog_index_name, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
    "The location and name of the file that remembers where the SQL replication \
 thread is in the relay logs.",
-   (uchar**) &relay_log_info_file, (uchar**) &relay_log_info_file, 0, GET_STR,
+   &relay_log_info_file, &relay_log_info_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replicate-do-db", OPT_REPLICATE_DO_DB,
-   "Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.",
+   "Tells the slave thread to restrict replication to the specified database. "
+   "To specify more than one database, use the directive multiple times, "
+   "once for each database. Note that this will only work if you do not use "
+   "cross-database queries such as UPDATE some_db.some_table SET foo='bar' "
+   "while having selected a different or no database. If you need cross "
+   "database updates to work, make sure you have 3.23.28 or later, and use "
+   "replicate-wild-do-table=db_name.%.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replicate-do-table", OPT_REPLICATE_DO_TABLE,
-   "Tells the slave thread to restrict replication to the specified table. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates, in contrast to replicate-do-db.",
-   0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Tells the slave thread to restrict replication to the specified table. "
+   "To specify more than one table, use the directive multiple times, once "
+   "for each table. This will work for cross-database updates, in contrast "
+   "to replicate-do-db.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replicate-ignore-db", OPT_REPLICATE_IGNORE_DB,
-   "Tells the slave thread to not replicate to the specified database. To specify more than one database to ignore, use the directive multiple times, once for each database. This option will not work if you use cross database updates. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-ignore-table=db_name.%. ",
-   0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Tells the slave thread to not replicate to the specified database. To "
+   "specify more than one database to ignore, use the directive multiple "
+   "times, once for each database. This option will not work if you use "
+   "cross database updates. If you need cross database updates to work, "
+   "make sure you have 3.23.28 or later, and use replicate-wild-ignore-"
+   "table=db_name.%. ", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replicate-ignore-table", OPT_REPLICATE_IGNORE_TABLE,
    "Tells the slave thread to not replicate to the specified table. To specify "
    "more than one table to ignore, use the directive multiple times, once for "
    "each table. This will work for cross-database updates, in contrast to "
-   "replicate-ignore-db.",
-   0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "replicate-ignore-db.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replicate-rewrite-db", OPT_REPLICATE_REWRITE_DB,
-   "Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name.",
+   "Updates to a database with a different name than the original. Example: "
+   "replicate-rewrite-db=master_db_name->slave_db_name.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_REPLICATION
   {"replicate-same-server-id", OPT_REPLICATE_SAME_SERVER_ID,
-   "In replication, if set to 1, do not skip events having our server id. \
-Default value is 0 (to break infinite loops in circular replication). \
-Can't be set to 1 if --log-slave-updates is used.",
-   (uchar**) &replicate_same_server_id,
-   (uchar**) &replicate_same_server_id,
+   "In replication, if set to 1, do not skip events having our server id. "
+   "Default value is 0 (to break infinite loops in circular replication). "
+   "Can't be set to 1 if --log-slave-updates is used.",
+   &replicate_same_server_id, &replicate_same_server_id,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"replicate-wild-do-table", OPT_REPLICATE_WILD_DO_TABLE,
-   "Tells the slave thread to restrict replication to the tables that match the specified wildcard pattern. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-do-table=foo%.bar% will replicate only updates to tables in all databases that start with foo and whose table names start with bar.",
+   "Tells the slave thread to restrict replication to the tables that match "
+   "the specified wildcard pattern. To specify more than one table, use the "
+   "directive multiple times, once for each table. This will work for cross-"
+   "database updates. Example: replicate-wild-do-table=foo%.bar% will "
+   "replicate only updates to tables in all databases that start with foo "
+   "and whose table names start with bar.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replicate-wild-ignore-table", OPT_REPLICATE_WILD_IGNORE_TABLE,
-   "Tells the slave thread to not replicate to the tables that match the given wildcard pattern. To specify more than one table to ignore, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% will not do updates to tables in databases that start with foo and whose table names start with bar.",
+   "Tells the slave thread to not replicate to the tables that match the "
+   "given wildcard pattern. To specify more than one table to ignore, use "
+   "the directive multiple times, once for each table. This will work for "
+   "cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% "
+   "will not do updates to tables in databases that start with foo and whose "
+   "table names start with bar.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   // In replication, we may need to tell the other servers how to connect
   {"report-host", OPT_REPORT_HOST,
@@ -6412,19 +6443,22 @@ Can't be set to 1 if --log-slave-updates
    "from the socket once the slave connects. Due to NAT and other routing "
    "issues, that IP may not be valid for connecting to the slave from the "
    "master or other hosts.",
-   (uchar**) &report_host, (uchar**) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
+   &report_host, &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
    0, 0, 0, 0},
   {"report-password", OPT_REPORT_PASSWORD, "Undocumented.",
-   (uchar**) &report_password, (uchar**) &report_password, 0, GET_STR,
+   &report_password, &report_password, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"report-port", OPT_REPORT_PORT,
-   "Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset.",
-   (uchar**) &report_port, (uchar**) &report_port, 0, GET_UINT, REQUIRED_ARG,
+   "Port for connecting to slave reported to the master during slave "
+   "registration. Set it only if the slave is listening on a non-default "
+   "port or if you have a special tunnel from the master or other clients "
+   "to the slave. If not sure, leave this option unset.",
+   &report_port, &report_port, 0, GET_UINT, REQUIRED_ARG,
    MYSQL_PORT, 0, 0, 0, 0, 0},
-  {"report-user", OPT_REPORT_USER, "Undocumented.", (uchar**) &report_user,
-   (uchar**) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"report-user", OPT_REPORT_USER, "Undocumented.", &report_user,
+   &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented.",
-   (uchar**) &rpl_recovery_rank, (uchar**) &rpl_recovery_rank, 0, GET_ULONG,
+   &rpl_recovery_rank, &rpl_recovery_rank, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -6435,21 +6469,21 @@ Can't be set to 1 if --log-slave-updates
 #endif
   {"safe-user-create", OPT_SAFE_USER_CREATE,
    "Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
-   (uchar**) &opt_safe_user_create, (uchar**) &opt_safe_user_create, 0, GET_BOOL,
+   &opt_safe_user_create, &opt_safe_user_create, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT,
    "Simulate memory shortage when compiled with the --with-debug=full option.",
    0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"secure-auth", OPT_SECURE_AUTH, "Disallow authentication for accounts that have old (pre-4.1) passwords.",
-   (uchar**) &opt_secure_auth, (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG,
+   &opt_secure_auth, &opt_secure_auth, 0, GET_BOOL, NO_ARG,
    my_bool(0), 0, 0, 0, 0, 0},
   {"secure-file-priv", OPT_SECURE_FILE_PRIV,
    "Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory.",
-   (uchar**) &opt_secure_file_priv, (uchar**) &opt_secure_file_priv, 0,
+   &opt_secure_file_priv, &opt_secure_file_priv, 0,
    GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-id",	OPT_SERVER_ID,
    "Uniquely identifies the server instance in the community of replication partners.",
-   (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32,
+   &server_id, &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32,
    0, 0, 0},
   {"set-variable", 'O',
    "Change the value of a variable. Please note that this option is deprecated; "
@@ -6457,22 +6491,22 @@ Can't be set to 1 if --log-slave-updates
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory", OPT_ENABLE_SHARED_MEMORY,
-   "Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory,
+   "Enable the shared memory.",&opt_enable_shared_memory, &opt_enable_shared_memory,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 #ifdef HAVE_SMEM
   {"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO,
    "Show user and password in SHOW SLAVE HOSTS on this master.",
-   (uchar**) &opt_show_slave_auth_info, (uchar**) &opt_show_slave_auth_info, 0,
+   &opt_show_slave_auth_info, &opt_show_slave_auth_info, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DISABLE_GRANT_OPTIONS
   {"skip-grant-tables", OPT_SKIP_GRANT,
    "Start without grant tables. This gives all users FULL ACCESS to all tables.",
-   (uchar**) &opt_noacl, (uchar**) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_noacl, &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
 #endif
   {"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0,
@@ -6499,49 +6533,55 @@ Can't be set to 1 if --log-slave-updates
    "Don't allow 'SHOW DATABASE' commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"skip-slave-start", OPT_SKIP_SLAVE_START,
-   "If set, slave is not autostarted.", (uchar**) &opt_skip_slave_start,
-   (uchar**) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "If set, slave is not autostarted.", &opt_skip_slave_start,
+   &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"skip-stack-trace", OPT_SKIP_STACK_TRACE,
    "Don't print a stack trace on failure.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
    0, 0, 0, 0},
-  {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Deprecated option. Use --skip-symbolic-links instead.",
+  {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. "
+  "Deprecated option. Use --skip-symbolic-links instead.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"skip-thread-priority", OPT_SKIP_PRIOR,
    "Don't give threads different priorities. Deprecated option.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    DEFAULT_SKIP_THREAD_PRIORITY, 0, 0, 0, 0, 0},
 #ifdef HAVE_REPLICATION
   {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
-   "The location where the slave should put its temporary files when \
-replicating a LOAD DATA INFILE command.",
-   (uchar**) &slave_load_tmpdir, (uchar**) &slave_load_tmpdir, 0, GET_STR_ALLOC,
+   "The location where the slave should put its temporary files when "
+   "replicating a LOAD DATA INFILE command.",
+   &slave_load_tmpdir, &slave_load_tmpdir, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS,
    "Tells the slave thread to continue replication when a query event returns an error from the provided list.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"slave-exec-mode", OPT_SLAVE_EXEC_MODE,
-   "Modes for how replication events should be executed. Legal values are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will not stop for operations that are idempotent. In STRICT mode, replication will stop on any unexpected difference between the master and the slave.",
-   (uchar**) &slave_exec_mode_str, (uchar**) &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Modes for how replication events should be executed. Legal values are "
+   "STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will "
+   "not stop for operations that are idempotent. In STRICT mode, replication "
+   "will stop on any unexpected difference between the master and the slave.",
+   &slave_exec_mode_str, &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"slow-query-log", OPT_SLOW_LOG,
-   "Enable/disable slow query log.", (uchar**) &opt_slow_log,
-   (uchar**) &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+   "Enable/disable slow query log.", &opt_slow_log,
+   &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", OPT_SOCKET, "Socket file to use for connection.",
-   (uchar**) &mysqld_unix_port, (uchar**) &mysqld_unix_port, 0, GET_STR,
+   &mysqld_unix_port, &mysqld_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_REPLICATION
   {"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL,
    "Option used by mysql-test for debugging and testing of replication.",
-   (uchar**) &opt_sporadic_binlog_dump_fail,
-   (uchar**) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_sporadic_binlog_dump_fail,
+   &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
 #endif /* HAVE_REPLICATION */
   {"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
-   "The update log is deprecated since version 5.0, is replaced by the binary \
-log and this option does nothing anymore.",
+   "The update log is deprecated since version 5.0, is replaced by the "
+   "binary log and this option does nothing anymore.",
    0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"sql-mode", OPT_SQL_MODE,
-   "Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.",
-   (uchar**) &sql_mode_str, (uchar**) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
+   "Syntax: sql-mode=option[,option[,option...]] where option can be one "
+   "of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, "
+   "ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.",
+   &sql_mode_str, &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
    0, 0, 0, 0, 0},
 #ifdef HAVE_OPENSSL
 #include "sslopt-longopts.h"
@@ -6552,7 +6592,7 @@ log and this option does nothing anymore
    NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"symbolic-links", 's', "Enable symbolic link support.",
-   (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
+   &my_use_symdir, &my_use_symdir, 0, GET_BOOL, NO_ARG,
    /*
      The system call realpath() produces warnings under valgrind and
      purify. These are not suppressed: instead we disable symlinks
@@ -6560,33 +6600,35 @@ log and this option does nothing anymore
    */
    IF_PURIFY(0,1), 0, 0, 0, 0, 0},
   {"sysdate-is-now", OPT_SYSDATE_IS_NOW,
-   "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.",
-   (uchar**) &global_system_variables.sysdate_is_now,
+   "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. "
+   "Since 5.0, SYSDATE() returns a `dynamic' value different for different "
+   "invocations, even within the same statement.",
+   &global_system_variables.sysdate_is_now,
    0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
   {"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER,
-   "Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK.",
-   (uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover,
+   "Decision to use in heuristic recover process. Possible values are COMMIT "
+   "or ROLLBACK.", &opt_tc_heuristic_recover, &opt_tc_heuristic_recover,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #if defined(ENABLED_DEBUG_SYNC)
   {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT,
    "Enable the debug sync facility "
    "and optionally specify a default wait timeout in seconds. "
    "A zero value keeps the facility disabled.",
-   (uchar**) &opt_debug_sync_timeout, 0,
+   &opt_debug_sync_timeout, 0,
    0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0},
 #endif /* defined(ENABLED_DEBUG_SYNC) */
   {"temp-pool", OPT_TEMP_POOL,
 #if (ENABLE_TEMP_POOL)
-   "Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
+   "Using this option will cause most temporary files created to use a small "
+   "set of names, rather than a unique name for each new file.",
 #else
    "This option is ignored on this OS.",
 #endif
-   (uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
+   &use_temp_pool, &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
-
   {"timed_mutexes", OPT_TIMED_MUTEXES,
    "Specify whether to time mutexes (only InnoDB mutexes are currently supported).",
-   (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0, 
+   &timed_mutexes, &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
     0, 0, 0, 0, 0},
   {"tmpdir", 't',
    "Path for temporary files. Several paths may be specified, separated by a "
@@ -6596,133 +6638,139 @@ log and this option does nothing anymore
    "colon (:)"
 #endif
    ", in this case they are used in a round-robin fashion.",
-   (uchar**) &opt_mysql_tmpdir,
-   (uchar**) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_mysql_tmpdir, &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG,
+   0, 0, 0, 0, 0, 0},
   {"transaction-isolation", OPT_TX_ISOLATION,
    "Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0,
    0, 0, 0, 0, 0},
-  {"use-symbolic-links", OPT_SYMBOLIC_LINKS, "Enable symbolic link support. Deprecated option; use --symbolic-links instead.",
-   (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
+  {"use-symbolic-links", OPT_SYMBOLIC_LINKS, "Enable symbolic link support. "
+   "Deprecated option; use --symbolic-links instead.",
+   &my_use_symdir, &my_use_symdir, 0, GET_BOOL, NO_ARG,
    IF_PURIFY(0,1), 0, 0, 0, 0, 0},
   {"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"verbose", 'v', "Used with --help option for detailed help.",
-   (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
-   0, 0},
+   &opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"warnings", OPT_WARNINGS, "Deprecated; use --log-warnings instead.",
-   (uchar**) &global_system_variables.log_warnings,
-   (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG,
+   &global_system_variables.log_warnings,
+   &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG,
    1, 0, ULONG_MAX, 0, 0, 0},
-  { "back_log", OPT_BACK_LOG,
-    "The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
-    (uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG,
-    REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 },
+  {"back_log", OPT_BACK_LOG,
+   "The number of outstanding connection requests MySQL can have. This "
+   "comes into play when the main MySQL thread gets very many connection "
+   "requests in a very short time.", &back_log, &back_log, 0, GET_ULONG,
+   REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 },
   {"binlog_cache_size", OPT_BINLOG_CACHE_SIZE,
-   "The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.",
-   (uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG,
+   "The size of the cache to hold the SQL statements for the binary log "
+   "during a transaction. If you often use big, multi-statement "
+   "transactions you can increase this to get more performance.",
+   &binlog_cache_size, &binlog_cache_size, 0, GET_ULONG,
    REQUIRED_ARG, 32*1024L, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0},
   {"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
-   "Size of tree cache used in bulk insert optimization. Note that this is a limit per thread.",
-   (uchar**) &global_system_variables.bulk_insert_buff_size,
-   (uchar**) &max_system_variables.bulk_insert_buff_size,
+   "Size of tree cache used in bulk insert optimization. Note that this "
+   "is a limit per thread.", &global_system_variables.bulk_insert_buff_size,
+   &max_system_variables.bulk_insert_buff_size,
    0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ULONG_MAX, 0, 1, 0},
   {"connect_timeout", OPT_CONNECT_TIMEOUT,
-   "The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.",
-    (uchar**) &connect_timeout, (uchar**) &connect_timeout,
+   "The number of seconds the mysqld server is waiting for a connect packet "
+   "before responding with 'Bad handshake'.", &connect_timeout, &connect_timeout,
    0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
   { "date_format", OPT_DATE_FORMAT,
     "The DATE format (for future).",
-    (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
-    (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
+    &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
+    &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   { "datetime_format", OPT_DATETIME_FORMAT,
     "The DATETIME/TIMESTAMP format (for future).",
-    (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
-    (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
+    &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
+    &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   { "default_week_format", OPT_DEFAULT_WEEK_FORMAT,
     "The default week format used by WEEK() functions.",
-    (uchar**) &global_system_variables.default_week_format,
-    (uchar**) &max_system_variables.default_week_format,
+    &global_system_variables.default_week_format,
+    &max_system_variables.default_week_format,
     0, GET_ULONG, REQUIRED_ARG, 0, 0, 7L, 0, 1, 0},
   {"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT,
-   "After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.",
-    (uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG,
+   "After inserting delayed_insert_limit rows, the INSERT DELAYED handler "
+   "will check if there are any SELECT statements pending. If so, it allows "
+   "these to execute before continuing.",
+    &delayed_insert_limit, &delayed_insert_limit, 0, GET_ULONG,
     REQUIRED_ARG, DELAYED_LIMIT, 1, ULONG_MAX, 0, 1, 0},
   {"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
    "How long a INSERT DELAYED thread should wait for INSERT statements before terminating.",
-   (uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0,
+   &delayed_insert_timeout, &delayed_insert_timeout, 0,
    GET_ULONG, REQUIRED_ARG, DELAYED_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
   { "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE,
-    "What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.",
-    (uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG,
+    "What size queue (in rows) should be allocated for handling INSERT DELAYED. "
+    "If the queue becomes full, any client that does INSERT DELAYED will wait "
+    "until there is room in the queue again.",
+    &delayed_queue_size, &delayed_queue_size, 0, GET_ULONG,
     REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ULONG_MAX, 0, 1, 0},
   {"div_precision_increment", OPT_DIV_PRECINCREMENT,
    "Precision of the result of '/' operator will be increased on that value.",
-   (uchar**) &global_system_variables.div_precincrement,
-   (uchar**) &max_system_variables.div_precincrement, 0, GET_ULONG,
+   &global_system_variables.div_precincrement,
+   &max_system_variables.div_precincrement, 0, GET_ULONG,
    REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0},
   {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS,
    "If non-zero, binary logs will be purged after expire_logs_days "
    "days; possible purges happen at startup and at binary log rotation.",
-   (uchar**) &expire_logs_days,
-   (uchar**) &expire_logs_days, 0, GET_ULONG,
+   &expire_logs_days, &expire_logs_days, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
   { "flush_time", OPT_FLUSH_TIME,
     "A dedicated thread is created to flush all tables at the given interval.",
-    (uchar**) &flush_time, (uchar**) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
+    &flush_time, &flush_time, 0, GET_ULONG, REQUIRED_ARG,
     FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0},
   { "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX,
     "List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE).",
-    0, 0, 0, GET_STR,
-    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   { "ft_max_word_len", OPT_FT_MAX_WORD_LEN,
-    "The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
-    (uchar**) &ft_max_word_len, (uchar**) &ft_max_word_len, 0, GET_ULONG,
+    "The maximum length of the word to be included in a FULLTEXT index. "
+    "Note: FULLTEXT indexes must be rebuilt after changing this variable.",
+    &ft_max_word_len, &ft_max_word_len, 0, GET_ULONG,
     REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0},
   { "ft_min_word_len", OPT_FT_MIN_WORD_LEN,
-    "The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
-    (uchar**) &ft_min_word_len, (uchar**) &ft_min_word_len, 0, GET_ULONG,
+    "The minimum length of the word to be included in a FULLTEXT index. "
+    "Note: FULLTEXT indexes must be rebuilt after changing this variable.",
+    &ft_min_word_len, &ft_min_word_len, 0, GET_ULONG,
     REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0},
   { "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT,
     "Number of best matches to use for query expansion.",
-    (uchar**) &ft_query_expansion_limit, (uchar**) &ft_query_expansion_limit, 0, GET_ULONG,
+    &ft_query_expansion_limit, &ft_query_expansion_limit, 0, GET_ULONG,
     REQUIRED_ARG, 20, 0, 1000, 0, 1, 0},
   { "ft_stopword_file", OPT_FT_STOPWORD_FILE,
     "Use stopwords from this file instead of built-in list.",
-    (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR,
+    &ft_stopword_file, &ft_stopword_file, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   { "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
     "The maximum length of the result of function group_concat.",
-    (uchar**) &global_system_variables.group_concat_max_len,
-    (uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
+    &global_system_variables.group_concat_max_len,
+    &max_system_variables.group_concat_max_len, 0, GET_ULONG,
     REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0},
   {"interactive_timeout", OPT_INTERACTIVE_TIMEOUT,
-   "The number of seconds the server waits for activity on an interactive connection before closing it.",
-   (uchar**) &global_system_variables.net_interactive_timeout,
-   (uchar**) &max_system_variables.net_interactive_timeout, 0,
+   "The number of seconds the server waits for activity on an interactive "
+   "connection before closing it.",
+   &global_system_variables.net_interactive_timeout,
+   &max_system_variables.net_interactive_timeout, 0,
    GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
   {"join_buffer_size", OPT_JOIN_BUFF_SIZE,
    "The size of the buffer that is used for full joins.",
-   (uchar**) &global_system_variables.join_buff_size,
-   (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG,
+   &global_system_variables.join_buff_size,
+   &max_system_variables.join_buff_size, 0, GET_ULONG,
    REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ULONG_MAX,
    MALLOC_OVERHEAD, IO_SIZE, 0},
   {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE,
    "Don't overwrite stale .MYD and .MYI even if no directory is specified.",
-   (uchar**) &global_system_variables.keep_files_on_create,
-   (uchar**) &max_system_variables.keep_files_on_create,
+   &global_system_variables.keep_files_on_create,
+   &max_system_variables.keep_files_on_create,
    0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"key_buffer_size", OPT_KEY_BUFFER_SIZE,
    "The size of the buffer used for index blocks for MyISAM tables. Increase "
    "this to get better index handling (for all reads and multiple writes) to "
    "as much as you can afford; 1GB on a 4GB machine that mainly runs MySQL is "
    "quite common.",
-   (uchar**) &dflt_key_cache_var.param_buff_size,
-   (uchar**) 0,
-   0, (GET_ULL | GET_ASK_ADDR),
+   &dflt_key_cache_var.param_buff_size, NULL, NULL, (GET_ULL | GET_ASK_ADDR),
    REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD,
    IO_SIZE, 0},
   {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
@@ -6730,34 +6778,27 @@ log and this option does nothing anymore
    "until it is considered aged enough to be downgraded to a warm block. "
    "This specifies the percentage ratio of that number of hits to the total "
    "number of blocks in key cache.",
-   (uchar**) &dflt_key_cache_var.param_age_threshold,
-   (uchar**) 0,
-   0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, 
-   300, 100, ULONG_MAX, 0, 100, 0},
+   &dflt_key_cache_var.param_age_threshold, NULL, NULL,
+   (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, 300, 100, ULONG_MAX, 0, 100, 0},
   {"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
    "The default size of key cache blocks.",
-   (uchar**) &dflt_key_cache_var.param_block_size,
-   (uchar**) 0,
-   0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
-   KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0},
+   &dflt_key_cache_var.param_block_size, NULL, NULL, (GET_ULONG | GET_ASK_ADDR),
+   REQUIRED_ARG, KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0},
   {"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
    "The minimum percentage of warm blocks in key cache.",
-   (uchar**) &dflt_key_cache_var.param_division_limit,
-   (uchar**) 0,
-   0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
-   1, 100, 0, 1, 0},
+   &dflt_key_cache_var.param_division_limit, NULL, NULL,
+   (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100, 1, 100, 0, 1, 0},
   {"long_query_time", OPT_LONG_QUERY_TIME,
    "Log all queries that have taken more than long_query_time seconds to "
    "execute. The argument will be treated as a decimal value with "
    "microsecond precision.",
-   (uchar**) &long_query_time, (uchar**) &long_query_time, 0, GET_DOUBLE,
+   &long_query_time, &long_query_time, 0, GET_DOUBLE,
    REQUIRED_ARG, 10, 0, LONG_TIMEOUT, 0, 0, 0},
   {"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
    "If set to 1, table names are stored in lowercase on disk and table names "
    "will be case-insensitive.  Should be set to 2 if you are using a case-"
    "insensitive file system.",
-   (uchar**) &lower_case_table_names,
-   (uchar**) &lower_case_table_names, 0, GET_UINT, OPT_ARG,
+   &lower_case_table_names, &lower_case_table_names, 0, GET_UINT, OPT_ARG,
 #ifdef FN_NO_CASE_SENCE
     1
 #else
@@ -6766,399 +6807,422 @@ log and this option does nothing anymore
    , 0, 2, 0, 1, 0},
   {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
    "The maximum packet length to send to or receive from server.",
-   (uchar**) &global_system_variables.max_allowed_packet,
-   (uchar**) &max_system_variables.max_allowed_packet, 0, GET_ULONG,
+   &global_system_variables.max_allowed_packet,
+   &max_system_variables.max_allowed_packet, 0, GET_ULONG,
    REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
    "Can be used to restrict the total size used to cache a multi-transaction query.",
-   (uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0,
+   &max_binlog_cache_size, &max_binlog_cache_size, 0,
    GET_ULL, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONGLONG_MAX, 0, IO_SIZE, 0},
   {"max_binlog_size", OPT_MAX_BINLOG_SIZE,
-   "Binary log will be rotated automatically when the size exceeds this \
-value. Will also apply to relay logs if max_relay_log_size is 0. \
-The minimum value for this variable is 4096.",
-   (uchar**) &max_binlog_size, (uchar**) &max_binlog_size, 0, GET_ULONG,
+   "Binary log will be rotated automatically when the size exceeds this "
+   "value. Will also apply to relay logs if max_relay_log_size is 0. "
+   "The minimum value for this variable is 4096.",
+   &max_binlog_size, &max_binlog_size, 0, GET_ULONG,
    REQUIRED_ARG, 1024*1024L*1024L, IO_SIZE, 1024*1024L*1024L, 0, IO_SIZE, 0},
   {"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
-   "If there is more than this number of interrupted connections from a host this host will be blocked from further connections.",
-   (uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG,
-    REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0},
+   "If there is more than this number of interrupted connections from a host "
+   "this host will be blocked from further connections.",
+   &max_connect_errors, &max_connect_errors, 0, GET_ULONG,
+   REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0},
   // Default max_connections of 151 is larger than Apache's default max
   // children, to avoid "too many connections" error in a common setup
   {"max_connections", OPT_MAX_CONNECTIONS,
-   "The number of simultaneous clients allowed.", (uchar**) &max_connections,
-   (uchar**) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1,
-   0},
+   "The number of simultaneous clients allowed.", &max_connections,
+   &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1, 0},
   {"max_delayed_threads", OPT_MAX_DELAYED_THREADS,
-   "Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.",
-   (uchar**) &global_system_variables.max_insert_delayed_threads,
-   (uchar**) &max_system_variables.max_insert_delayed_threads,
+   "Don't start more than this number of threads to handle INSERT DELAYED "
+   "statements. If set to zero, which means INSERT DELAYED is not used.",
+   &global_system_variables.max_insert_delayed_threads,
+   &max_system_variables.max_insert_delayed_threads,
    0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0},
   {"max_error_count", OPT_MAX_ERROR_COUNT,
    "Max number of errors/warnings to store for a statement.",
-   (uchar**) &global_system_variables.max_error_count,
-   (uchar**) &max_system_variables.max_error_count,
+   &global_system_variables.max_error_count,
+   &max_system_variables.max_error_count,
    0, GET_ULONG, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0},
   {"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE,
    "Don't allow creation of heap tables bigger than this.",
-   (uchar**) &global_system_variables.max_heap_table_size,
-   (uchar**) &max_system_variables.max_heap_table_size, 0, GET_ULL,
+   &global_system_variables.max_heap_table_size,
+   &max_system_variables.max_heap_table_size, 0, GET_ULL,
    REQUIRED_ARG, 16*1024*1024L, 16384, MAX_MEM_TABLE_SIZE,
    MALLOC_OVERHEAD, 1024, 0},
   {"max_join_size", OPT_MAX_JOIN_SIZE,
    "Joins that are probably going to read more than max_join_size records return an error.",
-   (uchar**) &global_system_variables.max_join_size,
-   (uchar**) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
+   &global_system_variables.max_join_size,
+   &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
    HA_POS_ERROR, 1, HA_POS_ERROR, 0, 1, 0},
    {"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA,
     "Max number of bytes in sorted records.",
-    (uchar**) &global_system_variables.max_length_for_sort_data,
-    (uchar**) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
+    &global_system_variables.max_length_for_sort_data,
+    &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
     REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
   {"max_prepared_stmt_count", OPT_MAX_PREPARED_STMT_COUNT,
    "Maximum number of prepared statements in the server.",
-   (uchar**) &max_prepared_stmt_count, (uchar**) &max_prepared_stmt_count,
+   &max_prepared_stmt_count, &max_prepared_stmt_count,
    0, GET_ULONG, REQUIRED_ARG, 16382, 0, 1*1024*1024, 0, 1, 0},
   {"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE,
-   "If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 excepted, the minimum value for this variable is 4096.",
-   (uchar**) &max_relay_log_size, (uchar**) &max_relay_log_size, 0, GET_ULONG,
+   "If non-zero: relay log will be rotated automatically when the size "
+   "exceeds this value; if zero (the default): when the size exceeds "
+   "max_binlog_size. 0 excepted, the minimum value for this variable is 4096.",
+   &max_relay_log_size, &max_relay_log_size, 0, GET_ULONG,
    REQUIRED_ARG, 0L, 0L, 1024*1024L*1024L, 0, IO_SIZE, 0},
   { "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY,
     "Limit assumed max number of seeks when looking up rows based on a key.",
-    (uchar**) &global_system_variables.max_seeks_for_key,
-    (uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
+    &global_system_variables.max_seeks_for_key,
+    &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
     REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0 },
   {"max_sort_length", OPT_MAX_SORT_LENGTH,
-   "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
-   (uchar**) &global_system_variables.max_sort_length,
-   (uchar**) &max_system_variables.max_sort_length, 0, GET_ULONG,
+   "The number of bytes to use when sorting BLOB or TEXT values (only the "
+   "first max_sort_length bytes of each value are used; the rest are ignored).",
+   &global_system_variables.max_sort_length,
+   &max_system_variables.max_sort_length, 0, GET_ULONG,
    REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
   {"max_sp_recursion_depth", OPT_MAX_SP_RECURSION_DEPTH,
    "Maximum stored procedure recursion depth. (discussed with docs).",
-   (uchar**) &global_system_variables.max_sp_recursion_depth,
-   (uchar**) &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG,
+   &global_system_variables.max_sp_recursion_depth,
+   &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG,
    OPT_ARG, 0, 0, 255, 0, 1, 0 },
   {"max_tmp_tables", OPT_MAX_TMP_TABLES,
    "Maximum number of temporary tables a client can keep open at a time.",
-   (uchar**) &global_system_variables.max_tmp_tables,
-   (uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
+   &global_system_variables.max_tmp_tables,
+   &max_system_variables.max_tmp_tables, 0, GET_ULONG,
    REQUIRED_ARG, 32, 1, ULONG_MAX, 0, 1, 0},
   {"max_user_connections", OPT_MAX_USER_CONNECTIONS,
    "The maximum number of active connections for a single user (0 = no limit).",
-   (uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
+   &max_user_connections, &max_user_connections, 0, GET_UINT,
    REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0},
   {"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
    "After this many write locks, allow some read locks to run in between.",
-   (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
+   &max_write_lock_count, &max_write_lock_count, 0, GET_ULONG,
    REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0},
   {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT,
    "Don't log queries which examine less than min_examined_row_limit rows to file.",
-   (uchar**) &global_system_variables.min_examined_row_limit,
-   (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
+   &global_system_variables.min_examined_row_limit,
+   &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
   REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0},
   {"multi_range_count", OPT_MULTI_RANGE_COUNT,
    "Number of key ranges to request at once.",
-   (uchar**) &global_system_variables.multi_range_count,
-   (uchar**) &max_system_variables.multi_range_count, 0,
+   &global_system_variables.multi_range_count,
+   &max_system_variables.multi_range_count, 0,
    GET_ULONG, REQUIRED_ARG, 256, 1, ULONG_MAX, 0, 1, 0},
   {"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
    "Block size to be used for MyISAM index pages.",
-   (uchar**) &opt_myisam_block_size,
-   (uchar**) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
+   &opt_myisam_block_size, &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
    MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
    0, MI_MIN_KEY_BLOCK_LENGTH, 0},
   {"myisam_data_pointer_size", OPT_MYISAM_DATA_POINTER_SIZE,
    "Default pointer size to be used for MyISAM tables.",
-   (uchar**) &myisam_data_pointer_size,
-   (uchar**) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
+   &myisam_data_pointer_size,
+   &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
    6, 2, 7, 0, 1, 0},
   {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
-   "This is a deprecated option that does nothing anymore.  It will be removed in MySQL " 
-   VER_CELOSIA,
-   (uchar**) &global_system_variables.myisam_max_extra_sort_file_size,
-   (uchar**) &max_system_variables.myisam_max_extra_sort_file_size,
+   "This is a deprecated option that does nothing anymore. "
+   "It will be removed in MySQL " VER_CELOSIA,
+   &global_system_variables.myisam_max_extra_sort_file_size,
+   &max_system_variables.myisam_max_extra_sort_file_size,
    0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH,
    0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0},
   {"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE,
-   "Don't use the fast sort index method to created index if the temporary file would get bigger than this.",
-   (uchar**) &global_system_variables.myisam_max_sort_file_size,
-   (uchar**) &max_system_variables.myisam_max_sort_file_size, 0,
+   "Don't use the fast sort index method to created index if the temporary "
+   "file would get bigger than this.",
+   &global_system_variables.myisam_max_sort_file_size,
+   &max_system_variables.myisam_max_sort_file_size, 0,
    GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE,
    0, 1024*1024, 0},
   {"myisam_mmap_size", OPT_MYISAM_MMAP_SIZE,
    "Can be used to restrict the total memory used for memory mmaping of myisam files",
-   (uchar**) &myisam_mmap_size, (uchar**) &myisam_mmap_size, 0,
+   &myisam_mmap_size, &myisam_mmap_size, 0,
    GET_ULL, REQUIRED_ARG, SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 0, 1, 0},
   {"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS,
    "Specifies whether several threads should be used when repairing MyISAM "
    "tables. For values > 1, one thread is used per index. The value of 1 "
    "disables parallel repair.",
-   (uchar**) &global_system_variables.myisam_repair_threads,
-   (uchar**) &max_system_variables.myisam_repair_threads, 0,
+   &global_system_variables.myisam_repair_threads,
+   &max_system_variables.myisam_repair_threads, 0,
    GET_ULONG, REQUIRED_ARG, 1, 1, ULONG_MAX, 0, 1, 0},
   {"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
-   "The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
-   (uchar**) &global_system_variables.myisam_sort_buff_size,
-   (uchar**) &max_system_variables.myisam_sort_buff_size, 0,
+   "The buffer that is allocated when sorting the index when doing a REPAIR "
+   "or when creating indexes with CREATE INDEX or ALTER TABLE.",
+   &global_system_variables.myisam_sort_buff_size,
+   &max_system_variables.myisam_sort_buff_size, 0,
    GET_ULONG, REQUIRED_ARG, 8192 * 1024, 4096, ~0L, 0, 1, 0},
   {"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
    "Use memory mapping for reading and writing MyISAM tables.",
-   (uchar**) &opt_myisam_use_mmap,
-   (uchar**) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0, 
-    0, 0, 0, 0, 0},
+   &opt_myisam_use_mmap, &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG,
+   0, 0, 0, 0, 0, 0},
   {"myisam_stats_method", OPT_MYISAM_STATS_METHOD,
    "Specifies how MyISAM index statistics collection code should threat NULLs. "
    "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
    "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
-   (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0,
+   &myisam_stats_method_str, &myisam_stats_method_str, 0,
     GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
    "Buffer length for TCP/IP and socket communication.",
-   (uchar**) &global_system_variables.net_buffer_length,
-   (uchar**) &max_system_variables.net_buffer_length, 0, GET_ULONG,
+   &global_system_variables.net_buffer_length,
+   &max_system_variables.net_buffer_length, 0, GET_ULONG,
    REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0},
   {"net_read_timeout", OPT_NET_READ_TIMEOUT,
    "Number of seconds to wait for more data from a connection before aborting the read.",
-   (uchar**) &global_system_variables.net_read_timeout,
-   (uchar**) &max_system_variables.net_read_timeout, 0, GET_ULONG,
+   &global_system_variables.net_read_timeout,
+   &max_system_variables.net_read_timeout, 0, GET_ULONG,
    REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
   {"net_retry_count", OPT_NET_RETRY_COUNT,
    "If a read on a communication port is interrupted, retry this many times before giving up.",
-   (uchar**) &global_system_variables.net_retry_count,
-   (uchar**) &max_system_variables.net_retry_count,0,
+   &global_system_variables.net_retry_count,
+   &max_system_variables.net_retry_count,0,
    GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ULONG_MAX, 0, 1, 0},
   {"net_write_timeout", OPT_NET_WRITE_TIMEOUT,
    "Number of seconds to wait for a block to be written to a connection before "
    "aborting the write.",
-   (uchar**) &global_system_variables.net_write_timeout,
-   (uchar**) &max_system_variables.net_write_timeout, 0, GET_ULONG,
+   &global_system_variables.net_write_timeout,
+   &max_system_variables.net_write_timeout, 0, GET_ULONG,
    REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
   { "old", OPT_OLD_MODE, "Use compatible behavior.", 
-    (uchar**) &global_system_variables.old_mode,
-    (uchar**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, 
+    &global_system_variables.old_mode,
+    &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, 
     0, 0, 0, 0, 0, 0},
   {"open_files_limit", OPT_OPEN_FILES_LIMIT,
-   "If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
-   (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
+   "If this is not 0, then mysqld will use this value to reserve file "
+   "descriptors to use with setrlimit(). If this value is 0 then mysqld "
+   "will reserve max_connections*5 or max_connections + table_cache*2 "
+   "(whichever is larger) number of files.",
+   &open_files_limit, &open_files_limit, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0},
   {"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL,
-   "Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows.",
-   (uchar**) &global_system_variables.optimizer_prune_level,
-   (uchar**) &max_system_variables.optimizer_prune_level,
+   "Controls the heuristic(s) applied during query optimization to prune "
+   "less-promising partial plans from the optimizer search space. Meaning: "
+   "0 - do not apply any heuristic, thus perform exhaustive search; 1 - "
+   "prune plans based on number of retrieved rows.",
+   &global_system_variables.optimizer_prune_level,
+   &max_system_variables.optimizer_prune_level,
    0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0},
   {"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH,
-   "Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).",
-   (uchar**) &global_system_variables.optimizer_search_depth,
-   (uchar**) &max_system_variables.optimizer_search_depth,
+   "Maximum depth of search performed by the query optimizer. Values larger "
+   "than the number of relations in a query result in better query plans, "
+   "but take longer to compile a query. Smaller values than the number of "
+   "tables in a relation result in faster optimization, but may produce "
+   "very bad query plans. If set to 0, the system will automatically pick "
+   "a reasonable value; if set to MAX_TABLES+2, the optimizer will switch "
+   "to the original find_best (used for testing/comparison).",
+   &global_system_variables.optimizer_search_depth,
+   &max_system_variables.optimizer_search_depth,
    0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
   {"optimizer_switch", OPT_OPTIMIZER_SWITCH,
    "optimizer_switch=option=val[,option=val...], where option={index_merge, "
    "index_merge_union, index_merge_sort_union, index_merge_intersection} and "
    "val={on, off, default}.",
-   (uchar**) &optimizer_switch_str, (uchar**) &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG, 
-   /*OPTIMIZER_SWITCH_DEFAULT*/0,
-   0, 0, 0, 0, 0},
+   &optimizer_switch_str, &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG,
+   /*OPTIMIZER_SWITCH_DEFAULT*/0, 0, 0, 0, 0, 0},
   {"plugin_dir", OPT_PLUGIN_DIR,
    "Directory for plugins.",
-   (uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0,
+   &opt_plugin_dir_ptr, &opt_plugin_dir_ptr, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"plugin-load", OPT_PLUGIN_LOAD,
    "Optional semicolon-separated list of plugins to load, where each plugin is "
    "identified as name=library, where name is the plugin name and library "
    "is the plugin library in plugin_dir.",
-   (uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
+   &opt_plugin_load, &opt_plugin_load, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
    "The size of the buffer that is allocated when preloading indexes.",
-   (uchar**) &global_system_variables.preload_buff_size,
-   (uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG,
+   &global_system_variables.preload_buff_size,
+   &max_system_variables.preload_buff_size, 0, GET_ULONG,
    REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0},
   {"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE,
    "Allocation block size for query parsing and execution.",
-   (uchar**) &global_system_variables.query_alloc_block_size,
-   (uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
+   &global_system_variables.query_alloc_block_size,
+   &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
    REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
 #ifdef HAVE_QUERY_CACHE
   {"query_cache_limit", OPT_QUERY_CACHE_LIMIT,
    "Don't cache results that are bigger than this.",
-   (uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG,
+   &query_cache_limit, &query_cache_limit, 0, GET_ULONG,
    REQUIRED_ARG, 1024*1024L, 0, ULONG_MAX, 0, 1, 0},
   {"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT,
    "Minimal size of unit in which space for results is allocated (last unit "
    "will be trimmed after writing all result data).",
-   (uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit,
+   &query_cache_min_res_unit, &query_cache_min_res_unit,
    0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE,
    0, ULONG_MAX, 0, 1, 0},
 #endif /*HAVE_QUERY_CACHE*/
   {"query_cache_size", OPT_QUERY_CACHE_SIZE,
    "The memory allocated to store results from old queries.",
-   (uchar**) &query_cache_size, (uchar**) &query_cache_size, 0, GET_ULONG,
+   &query_cache_size, &query_cache_size, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1024, 0},
 #ifdef HAVE_QUERY_CACHE
   {"query_cache_type", OPT_QUERY_CACHE_TYPE,
-   "0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT SQL_CACHE ... queries.",
-   (uchar**) &global_system_variables.query_cache_type,
-   (uchar**) &max_system_variables.query_cache_type,
+   "0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results "
+   "except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT "
+   "SQL_CACHE ... queries.", &global_system_variables.query_cache_type,
+   &max_system_variables.query_cache_type,
    0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0},
   {"query_cache_wlock_invalidate", OPT_QUERY_CACHE_WLOCK_INVALIDATE,
    "Invalidate queries in query cache on LOCK for write.",
-   (uchar**) &global_system_variables.query_cache_wlock_invalidate,
-   (uchar**) &max_system_variables.query_cache_wlock_invalidate,
+   &global_system_variables.query_cache_wlock_invalidate,
+   &max_system_variables.query_cache_wlock_invalidate,
    0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
 #endif /*HAVE_QUERY_CACHE*/
   {"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE,
    "Persistent buffer for query parsing and execution.",
-   (uchar**) &global_system_variables.query_prealloc_size,
-   (uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
+   &global_system_variables.query_prealloc_size,
+   &max_system_variables.query_prealloc_size, 0, GET_ULONG,
    REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE,
    ULONG_MAX, 0, 1024, 0},
   {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE,
    "Allocation block size for storing ranges during optimization.",
-   (uchar**) &global_system_variables.range_alloc_block_size,
-   (uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
+   &global_system_variables.range_alloc_block_size,
+   &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
    REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX,
    0, 1024, 0},
   {"read_buffer_size", OPT_RECORD_BUFFER,
-   "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
-   (uchar**) &global_system_variables.read_buff_size,
-   (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
+   "Each thread that does a sequential scan allocates a buffer of this size "
+   "for each table it scans. If you do many sequential scans, you may want "
+   "to increase this value.", &global_system_variables.read_buff_size,
+   &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
    128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE,
    0},
   {"read_only", OPT_READONLY,
    "Make all non-temporary tables read-only, with the exception of replication "
    "(slave) threads and users with the SUPER privilege.",
-   (uchar**) &opt_readonly,
-   (uchar**) &opt_readonly,
+   &opt_readonly,
+   &opt_readonly,
    0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
   {"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER,
    "When reading rows in sorted order after a sort, the rows are read through "
    "this buffer to avoid disk seeks. If not set, then it's set to the value of "
    "record_buffer.",
-   (uchar**) &global_system_variables.read_rnd_buff_size,
-   (uchar**) &max_system_variables.read_rnd_buff_size, 0,
+   &global_system_variables.read_rnd_buff_size,
+   &max_system_variables.read_rnd_buff_size, 0,
    GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD,
    INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0},
   {"record_buffer", OPT_RECORD_BUFFER_OLD,
    "Alias for read_buffer_size. This variable is deprecated and will be removed in a future release.",
-   (uchar**) &global_system_variables.read_buff_size,
-   (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
+   &global_system_variables.read_buff_size,
+   &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
    128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0},
 #ifdef HAVE_REPLICATION
   {"relay_log_purge", OPT_RELAY_LOG_PURGE,
    "0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.",
-   (uchar**) &relay_log_purge,
-   (uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG,
+   &relay_log_purge,
+   &relay_log_purge, 0, GET_BOOL, NO_ARG,
    1, 0, 1, 0, 1, 0},
   {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
    "Maximum space to use for all relay logs.",
-   (uchar**) &relay_log_space_limit,
-   (uchar**) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
+   &relay_log_space_limit,
+   &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
    (longlong) ULONG_MAX, 0, 1, 0},
   {"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
    "Use compression on master/slave protocol.",
-   (uchar**) &opt_slave_compressed_protocol,
-   (uchar**) &opt_slave_compressed_protocol,
+   &opt_slave_compressed_protocol,
+   &opt_slave_compressed_protocol,
    0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
   {"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT,
    "Number of seconds to wait for more data from a master/slave connection before aborting the read.",
-   (uchar**) &slave_net_timeout, (uchar**) &slave_net_timeout, 0,
+   &slave_net_timeout, &slave_net_timeout, 0,
    GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
   {"slave_transaction_retries", OPT_SLAVE_TRANS_RETRIES,
    "Number of times the slave SQL thread will retry a transaction in case "
    "it failed with a deadlock or elapsed lock wait timeout, "
    "before giving up and stopping.",
-   (uchar**) &slave_trans_retries, (uchar**) &slave_trans_retries, 0,
+   &slave_trans_retries, &slave_trans_retries, 0,
    GET_ULONG, REQUIRED_ARG, 10L, 0L, (longlong) ULONG_MAX, 0, 1, 0},
 #endif /* HAVE_REPLICATION */
   {"slow_launch_time", OPT_SLOW_LAUNCH_TIME,
-   "If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.",
-   (uchar**) &slow_launch_time, (uchar**) &slow_launch_time, 0, GET_ULONG,
+   "If creating the thread takes longer than this value (in seconds), "
+   "the Slow_launch_threads counter will be incremented.",
+   &slow_launch_time, &slow_launch_time, 0, GET_ULONG,
    REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0},
   {"sort_buffer_size", OPT_SORT_BUFFER,
    "Each thread that needs to do a sort allocates a buffer of this size.",
-   (uchar**) &global_system_variables.sortbuff_size,
-   (uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
+   &global_system_variables.sortbuff_size,
+   &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
    MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD,
    1, 0},
   {"sync-binlog", OPT_SYNC_BINLOG,
    "Synchronously flush binary log to disk after every #th event. "
    "Use 0 (default) to disable synchronous flushing.",
-   (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG,
+   &sync_binlog_period, &sync_binlog_period, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0},
   {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
-   (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
+   &opt_sync_frm, &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
    0, 0, 0, 0},
   {"table_cache", OPT_TABLE_OPEN_CACHE,
    "Deprecated; use --table_open_cache instead.",
-   (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
+   &table_cache_size, &table_cache_size, 0, GET_ULONG,
    REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
   {"table_definition_cache", OPT_TABLE_DEF_CACHE,
    "The number of cached table definitions.",
-   (uchar**) &table_def_size, (uchar**) &table_def_size,
+   &table_def_size, &table_def_size,
    0, GET_ULONG, REQUIRED_ARG, TABLE_DEF_CACHE_DEFAULT, TABLE_DEF_CACHE_MIN,
    512*1024L, 0, 1, 0},
   {"table_open_cache", OPT_TABLE_OPEN_CACHE,
    "The number of cached open tables.",
-   (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
+   &table_cache_size, &table_cache_size, 0, GET_ULONG,
    REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
   {"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT,
    "Timeout in seconds to wait for a table level lock before returning an "
    "error. Used only if the connection has active cursors.",
-   (uchar**) &table_lock_wait_timeout, (uchar**) &table_lock_wait_timeout,
+   &table_lock_wait_timeout, &table_lock_wait_timeout,
    0, GET_ULONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
   {"thread_cache_size", OPT_THREAD_CACHE_SIZE,
    "How many threads we should keep in a cache for reuse.",
-   (uchar**) &thread_cache_size, (uchar**) &thread_cache_size, 0, GET_ULONG,
+   &thread_cache_size, &thread_cache_size, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, 16384, 0, 1, 0},
   {"thread_concurrency", OPT_THREAD_CONCURRENCY,
-   "Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.",
-   (uchar**) &concurrency, (uchar**) &concurrency, 0, GET_ULONG, REQUIRED_ARG,
+   "Permits the application to give the threads system a hint for the "
+   "desired number of threads that should be run at the same time.",
+   &concurrency, &concurrency, 0, GET_ULONG, REQUIRED_ARG,
    DEFAULT_CONCURRENCY, 1, 512, 0, 1, 0},
 #if HAVE_POOL_OF_THREADS == 1
   {"thread_pool_size", OPT_THREAD_CACHE_SIZE,
    "How many threads we should create to handle query requests in case of "
    "'thread_handling=pool-of-threads'.",
-   (uchar**) &thread_pool_size, (uchar**) &thread_pool_size, 0, GET_ULONG,
+   &thread_pool_size, &thread_pool_size, 0, GET_ULONG,
    REQUIRED_ARG, 20, 1, 16384, 0, 1, 0},
 #endif
   {"thread_stack", OPT_THREAD_STACK,
-   "The stack size for each thread.", (uchar**) &my_thread_stack_size,
-   (uchar**) &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
+   "The stack size for each thread.", &my_thread_stack_size,
+   &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
    1024L*128L, ULONG_MAX, 0, 1024, 0},
   { "time_format", OPT_TIME_FORMAT,
     "The TIME format (for future).",
-    (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
-    (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
+    &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
+    &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"tmp_table_size", OPT_TMP_TABLE_SIZE,
    "If an internal in-memory temporary table exceeds this size, MySQL will"
    " automatically convert it to an on-disk MyISAM table.",
-   (uchar**) &global_system_variables.tmp_table_size,
-   (uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL,
+   &global_system_variables.tmp_table_size,
+   &max_system_variables.tmp_table_size, 0, GET_ULL,
    REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0},
   {"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE,
    "Allocation block size for transactions to be stored in binary log.",
-   (uchar**) &global_system_variables.trans_alloc_block_size,
-   (uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
+   &global_system_variables.trans_alloc_block_size,
+   &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
    REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
   {"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
    "Persistent buffer for transactions to be stored in binary log.",
-   (uchar**) &global_system_variables.trans_prealloc_size,
-   (uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
+   &global_system_variables.trans_prealloc_size,
+   &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
    REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
   {"thread_handling", OPT_THREAD_HANDLING,
    "Define threads usage for handling queries: "
    "one-thread-per-connection or no-threads.", 0, 0,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT,
-   "1 = YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools).",
-   (uchar**) &global_system_variables.updatable_views_with_limit,
-   (uchar**) &max_system_variables.updatable_views_with_limit,
+   "1 = YES = Don't issue an error message (warning only) if a VIEW without "
+   "presence of a key of the underlying table is used in queries with a "
+   "LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which "
+   "does not contain a key of the underlying table and the query uses a "
+   "LIMIT clause (usually get from GUI tools).",
+   &global_system_variables.updatable_views_with_limit,
+   &max_system_variables.updatable_views_with_limit,
    0, GET_ULONG, REQUIRED_ARG, 1, 0, 1, 0, 1, 0},
   {"wait_timeout", OPT_WAIT_TIMEOUT,
    "The number of seconds the server waits for activity on a connection before closing it.",
-   (uchar**) &global_system_variables.net_wait_timeout,
-   (uchar**) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
+   &global_system_variables.net_wait_timeout,
+   &max_system_variables.net_wait_timeout, 0, GET_ULONG,
    REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
    0, 1, 0},
   {"binlog-direct-non-transactional-updates", OPT_BINLOG_DIRECT_NON_TRANS_UPDATE,
@@ -7167,8 +7231,9 @@ The minimum value for this variable is 4
    "there are no dependencies between transactional and non-transactional "
    "tables such as in the statement INSERT INTO t_myisam SELECT * FROM "
    "t_innodb; otherwise, slaves may diverge from the master.",
-   (uchar**) &global_system_variables.binlog_direct_non_trans_update, (uchar**) &max_system_variables.binlog_direct_non_trans_update, 0, GET_BOOL, NO_ARG, 0,
-    0, 0, 0, 0, 0},
+   &global_system_variables.binlog_direct_non_trans_update,
+   &max_system_variables.binlog_direct_non_trans_update,
+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
@@ -8597,13 +8662,12 @@ mysqld_get_one_option(int optid,
 
 
 /** Handle arguments for multiple key caches. */
+C_MODE_START
+static void* mysql_getopt_value(const char *, uint,
+                                const struct my_option *, int *);
+C_MODE_END
 
-extern "C" int mysql_getopt_value(uchar **value,
-                                  const char *keyname, uint key_length,
-                                  const struct my_option *option,
-                                  int *error);
-
-static uchar* *
+static void*
 mysql_getopt_value(const char *keyname, uint key_length,
 		   const struct my_option *option, int *error)
 {
@@ -8624,13 +8688,13 @@ mysql_getopt_value(const char *keyname, 
     }
     switch (option->id) {
     case OPT_KEY_BUFFER_SIZE:
-      return (uchar**) &key_cache->param_buff_size;
+      return &key_cache->param_buff_size;
     case OPT_KEY_CACHE_BLOCK_SIZE:
-      return (uchar**) &key_cache->param_block_size;
+      return &key_cache->param_block_size;
     case OPT_KEY_CACHE_DIVISION_LIMIT:
-      return (uchar**) &key_cache->param_division_limit;
+      return &key_cache->param_division_limit;
     case OPT_KEY_CACHE_AGE_THRESHOLD:
-      return (uchar**) &key_cache->param_age_threshold;
+      return &key_cache->param_age_threshold;
     }
   }
   }

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2010-04-22 13:52:00 +0000
+++ b/sql/sql_plugin.cc	2010-06-08 19:16:36 +0000
@@ -1913,10 +1913,6 @@ typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdv
 typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulong_t, ulong);
 typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulonglong_t, ulonglong);
 
-#define SET_PLUGIN_VAR_RESOLVE(opt)\
-  *(mysql_sys_var_ptr_p*)&((opt)->resolve)= mysql_sys_var_ptr
-typedef uchar *(*mysql_sys_var_ptr_p)(void* a_thd, int offset);
-
 
 /****************************************************************************
   default variable data check and update functions
@@ -2445,11 +2441,49 @@ static uchar *intern_sys_var_ptr(THD* th
   return (uchar*)thd->variables.dynamic_variables_ptr + offset;
 }
 
-static uchar *mysql_sys_var_ptr(void* a_thd, int offset)
+
+/**
+  For correctness and simplicity's sake, a pointer to a function
+  must be compatible with pointed-to type, that is, the return and
+  parameters types must be the same. Thus, a callback function is
+  defined for each scalar type. The functions are assigned in
+  construct_options to their respective types.
+*/
+
+static char *mysql_sys_var_char(THD* thd, int offset)
+{
+  return (char *) intern_sys_var_ptr(thd, offset, true);
+}
+
+static int *mysql_sys_var_int(THD* thd, int offset)
+{
+  return (int *) intern_sys_var_ptr(thd, offset, true);
+}
+
+static long *mysql_sys_var_long(THD* thd, int offset)
 {
-  return intern_sys_var_ptr((THD *)a_thd, offset, true);
+  return (long *) intern_sys_var_ptr(thd, offset, true);
 }
 
+static unsigned long *mysql_sys_var_ulong(THD* thd, int offset)
+{
+  return (unsigned long *) intern_sys_var_ptr(thd, offset, true);
+}
+
+static long long *mysql_sys_var_longlong(THD* thd, int offset)
+{
+  return (long long *) intern_sys_var_ptr(thd, offset, true);
+}
+
+static unsigned long long *mysql_sys_var_ulonglong(THD* thd, int offset)
+{
+  return (unsigned long long *) intern_sys_var_ptr(thd, offset, true);
+}
+
+static char **mysql_sys_var_str(THD* thd, int offset)
+{
+  return (char **) intern_sys_var_ptr(thd, offset, true);
+}
 
 void plugin_thdvar_init(THD *thd)
 {
@@ -3020,25 +3054,25 @@ static int construct_options(MEM_ROOT *m
       continue;
     switch (opt->flags & PLUGIN_VAR_TYPEMASK) {
     case PLUGIN_VAR_BOOL:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_bool_t *) opt);
+      ((thdvar_bool_t *) opt)->resolve= mysql_sys_var_char;
       break;
     case PLUGIN_VAR_INT:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_int_t *) opt);
+      ((thdvar_int_t *) opt)->resolve= mysql_sys_var_int;
       break;
     case PLUGIN_VAR_LONG:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_long_t *) opt);
+      ((thdvar_long_t *) opt)->resolve= mysql_sys_var_long;
       break;
     case PLUGIN_VAR_LONGLONG:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_longlong_t *) opt);
+      ((thdvar_longlong_t *) opt)->resolve= mysql_sys_var_longlong;
       break;
     case PLUGIN_VAR_STR:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_str_t *) opt);
+      ((thdvar_str_t *) opt)->resolve= mysql_sys_var_str;
       break;
     case PLUGIN_VAR_ENUM:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_enum_t *) opt);
+      ((thdvar_enum_t *) opt)->resolve= mysql_sys_var_ulong;
       break;
     case PLUGIN_VAR_SET:
-      SET_PLUGIN_VAR_RESOLVE((thdvar_set_t *) opt);
+      ((thdvar_set_t *) opt)->resolve= mysql_sys_var_ulonglong;
       break;
     default:
       sql_print_error("Unknown variable type code 0x%x in plugin '%s'.",

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2010-05-25 14:43:45 +0000
+++ b/sql/table.cc	2010-06-08 19:16:36 +0000
@@ -45,6 +45,8 @@ static uint find_field(Field **fields, u
 
 inline bool is_system_table_name(const char *name, uint length);
 
+static ulong get_form_pos(File file, uchar *head);
+
 /**************************************************************************
   Object_creation_ctx implementation.
 **************************************************************************/
@@ -693,7 +695,8 @@ static int open_binary_frm(THD *thd, TAB
   disk_buff= 0;
 
   error= 3;
-  if (!(pos=get_form_pos(file,head,(TYPELIB*) 0)))
+  /* Position of the form in the form file. */
+  if (!(pos= get_form_pos(file, head)))
     goto err;                                   /* purecov: inspected */
 
   share->frm_version= head[2];
@@ -2047,52 +2050,46 @@ void free_field_buffers_larger_than(TABL
   }
 }
 
-	/* Find where a form starts */
-	/* if formname is NullS then only formnames is read */
+/**
+  Find where a form starts.
+
+  @param head The start of the form file.
 
-ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
+  @remark If formname is NULL then only formnames is read.
+
+  @retval The form position.
+*/
+
+static ulong get_form_pos(File file, uchar *head)
 {
-  uint a_length,names,length;
-  uchar *pos,*buf;
+  uchar *pos, *buf;
+  uint names, length;
   ulong ret_value=0;
   DBUG_ENTER("get_form_pos");
 
-  names=uint2korr(head+8);
-  a_length=(names+2)*sizeof(char *);		/* Room for two extra */
+  names= uint2korr(head+8);
 
-  if (!save_names)
-    a_length=0;
-  else
-    save_names->type_names=0;			/* Clear if error */
+  if (!(names= uint2korr(head+8)))
+    DBUG_RETURN(0);
 
-  if (names)
-  {
-    length=uint2korr(head+4);
-    VOID(my_seek(file,64L,MY_SEEK_SET,MYF(0)));
-    if (!(buf= (uchar*) my_malloc((size_t) length+a_length+names*4,
-				  MYF(MY_WME))) ||
-	my_read(file, buf+a_length, (size_t) (length+names*4),
-		MYF(MY_NABP)))
-    {						/* purecov: inspected */
-      x_free((uchar*) buf);			/* purecov: inspected */
-      DBUG_RETURN(0L);				/* purecov: inspected */
-    }
-    pos= buf+a_length+length;
-    ret_value=uint4korr(pos);
-  }
-  if (! save_names)
-  {
-    if (names)
-      my_free((uchar*) buf,MYF(0));
-  }
-  else if (!names)
-    bzero((char*) save_names,sizeof(save_names));
-  else
+  length= uint2korr(head+4);
+
+  my_seek(file, 64L, MY_SEEK_SET, MYF(0));
+
+  if (!(buf= (uchar*) my_malloc(length+names*4, MYF(MY_WME))))
+    DBUG_RETURN(0);
+
+  if (my_read(file, buf, length+names*4, MYF(MY_NABP)))
   {
-    char *str;
-    str=(char *) (buf+a_length);
-    fix_type_pointers((const char ***) &buf,save_names,1,&str);
+    x_free(buf);
+    DBUG_RETURN(0);
   }
+
+  pos= buf+length;
+  ret_value= uint4korr(pos);
+
+  my_free(buf, MYF(0));
+
   DBUG_RETURN(ret_value);
 }
 

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2009-09-02 11:19:28 +0000
+++ b/sql/unireg.cc	2010-06-08 19:16:36 +0000
@@ -108,7 +108,6 @@ bool mysql_create_frm(THD *thd, const ch
   File file;
   ulong filepos, data_offset;
   uchar fileinfo[64],forminfo[288],*keybuff;
-  TYPELIB formnames;
   uchar *screen_buff;
   char buff[128];
 #ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -119,7 +118,7 @@ bool mysql_create_frm(THD *thd, const ch
   DBUG_ENTER("mysql_create_frm");
 
   DBUG_ASSERT(*fn_rext((char*)file_name)); // Check .frm extension
-  formnames.type_names=0;
+
   if (!(screen_buff=pack_screens(create_fields,&info_length,&screens,0)))
     DBUG_RETURN(1);
   DBUG_ASSERT(db_file != NULL);
@@ -194,8 +193,15 @@ bool mysql_create_frm(THD *thd, const ch
   key_buff_length= uint4korr(fileinfo+47);
   keybuff=(uchar*) my_malloc(key_buff_length, MYF(0));
   key_info_length= pack_keys(keybuff, keys, key_info, data_offset);
-  VOID(get_form_pos(file,fileinfo,&formnames));
-  if (!(filepos=make_new_entry(file,fileinfo,&formnames,"")))
+
+  /*
+    Ensure that there are no forms in this newly created form file.
+    Even if the form file exists, create_frm must truncate it to
+    ensure one form per form file.
+  */
+  DBUG_ASSERT(uint2korr(fileinfo+8) == 0);
+
+  if (!(filepos= make_new_entry(file, fileinfo, NULL, "")))
     goto err;
   maxlength=(uint) next_io_size((ulong) (uint2korr(forminfo)+1000));
   int2store(forminfo+2,maxlength);

=== modified file 'storage/archive/archive_reader.c'
--- a/storage/archive/archive_reader.c	2008-11-25 02:04:58 +0000
+++ b/storage/archive/archive_reader.c	2010-06-08 19:16:36 +0000
@@ -355,15 +355,14 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"set-auto-increment", 'A',
    "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
-   (uchar**) &new_auto_increment,
-   (uchar**) &new_auto_increment,
+   &new_auto_increment, &new_auto_increment,
    0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"silent", 's',
    "Only print errors. One can use two -s to make archive_reader very silent.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"tmpdir", 't',
    "Path for temporary files.",
-   (uchar**) &opt_tmpdir,
+   &opt_tmpdir,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V',
    "Print version and exit.",

=== modified file 'storage/myisam/ft_nlq_search.c'
--- a/storage/myisam/ft_nlq_search.c	2008-02-08 11:13:33 +0000
+++ b/storage/myisam/ft_nlq_search.c	2010-06-08 19:16:36 +0000
@@ -123,7 +123,7 @@ static int walk_and_match(FT_WORD *word,
       goto do_skip;
     }
 #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
-    tmp_weight=*(float*)&subkeys;
+    ft_floatXget(tmp_weight, info->lastkey+info->lastkey_length-extra);
 #else
 #error
 #endif

=== modified file 'storage/myisam/fulltext.h'
--- a/storage/myisam/fulltext.h	2007-05-10 09:59:39 +0000
+++ b/storage/myisam/fulltext.h	2010-06-08 19:16:36 +0000
@@ -24,8 +24,23 @@
 #define HA_FT_WLEN   4
 #define FT_SEGS      2
 
+/**
+  Accessor methods for the weight and the number of subkeys in a buffer.
+
+  The weight is of float type and subkeys number is of integer type. Both
+  are stored in the same position of the buffer and the stored object is
+  identified by the signedness: the weight value is positive whilst the
+  number of subkeys is negative.
+
+  In light of C's strict-aliasing rules, which roughly state that an object
+  must not be accessed through incompatible types, these methods are used to
+  avoid any problems arising from the type duality inside the buffer. The
+  values are retrieved using a character type which can access any object.
+*/
 #define ft_sintXkorr(A)    mi_sint4korr(A)
 #define ft_intXstore(T,A)  mi_int4store(T,A)
+#define ft_floatXget(V,M)  mi_float4get(V,M)
+
 
 extern const HA_KEYSEG ft_keysegs[FT_SEGS];
 

=== modified file 'storage/myisam/mi_test1.c'
--- a/storage/myisam/mi_test1.c	2008-03-31 07:40:39 +0000
+++ b/storage/myisam/mi_test1.c	2010-06-08 19:16:36 +0000
@@ -536,21 +536,21 @@ static struct my_option my_long_options[
   {"debug", '#', "Undocumented",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"delete_rows", 'd', "Undocumented", (uchar**) &remove_count,
-   (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+  {"delete_rows", 'd', "Undocumented", &remove_count,
+   &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
   {"help", '?', "Display help and exit",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"insert_rows", 'i', "Undocumented", (uchar**) &insert_count,
-   (uchar**) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+  {"insert_rows", 'i', "Undocumented", &insert_count,
+   &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
   {"key_alpha", 'a', "Use a key of type HA_KEYTYPE_TEXT",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"key_binary_pack", 'B', "Undocumented",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"key_blob", 'b', "Undocumented",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"key_cache", 'K', "Undocumented", (uchar**) &key_cacheing,
-   (uchar**) &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"key_length", 'k', "Undocumented", (uchar**) &key_length, (uchar**) &key_length,
+  {"key_cache", 'K', "Undocumented", &key_cacheing,
+   &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"key_length", 'k', "Undocumented", &key_length, &key_length,
    0, GET_UINT, REQUIRED_ARG, 6, 0, 0, 0, 0, 0},
   {"key_multiple", 'm', "Undocumented",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -561,21 +561,21 @@ static struct my_option my_long_options[
   {"key_varchar", 'w', "Test VARCHAR keys",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"null_fields", 'N', "Define fields with NULL",
-   (uchar**) &null_fields, (uchar**) &null_fields, 0, GET_BOOL, NO_ARG,
+   &null_fields, &null_fields, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"row_fixed_size", 'S', "Undocumented",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"row_pointer_size", 'R', "Undocumented", (uchar**) &rec_pointer_size,
-   (uchar**) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"row_pointer_size", 'R', "Undocumented", &rec_pointer_size,
+   &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"silent", 's', "Undocumented",
-   (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"skip_update", 'U', "Undocumented", (uchar**) &skip_update,
-   (uchar**) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"unique", 'C', "Undocumented", (uchar**) &opt_unique, (uchar**) &opt_unique, 0,
+   &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"skip_update", 'U', "Undocumented", &skip_update,
+   &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"unique", 'C', "Undocumented", &opt_unique, &opt_unique, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"update_rows", 'u', "Undocumented", (uchar**) &update_count,
-   (uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
-  {"verbose", 'v', "Be more verbose", (uchar**) &verbose, (uchar**) &verbose, 0,
+  {"update_rows", 'u', "Undocumented", &update_count,
+   &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Be more verbose", &verbose, &verbose, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Print version number and exit",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'storage/myisam/myisam_ftdump.c'
--- a/storage/myisam/myisam_ftdump.c	2007-05-10 09:59:39 +0000
+++ b/storage/myisam/myisam_ftdump.c	2010-06-08 19:16:36 +0000
@@ -113,7 +113,7 @@ int main(int argc,char *argv[])
 
     subkeys=ft_sintXkorr(info->lastkey+keylen+1);
     if (subkeys >= 0)
-      weight=*(float*)&subkeys;
+      ft_floatXget(weight,info->lastkey+keylen+1);
 
 #ifdef HAVE_SNPRINTF
     snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1);

=== modified file 'storage/myisam/myisamchk.c'
--- a/storage/myisam/myisamchk.c	2009-10-27 13:20:34 +0000
+++ b/storage/myisam/myisamchk.c	2010-06-08 19:16:36 +0000
@@ -168,7 +168,7 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
    "Directory where character sets are.",
-   (uchar**) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"check", 'c',
    "Check table for errors.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -188,8 +188,8 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"data-file-length", 'D',
    "Max length of data file (when recreating data-file when it's full).",
-   (uchar**) &check_param.max_data_file_length,
-   (uchar**) &check_param.max_data_file_length,
+   &check_param.max_data_file_length,
+   &check_param.max_data_file_length,
    0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"extend-check", 'e',
    "If used when checking a table, ensure that the table is 100 percent consistent, which will take a long time. If used when repairing a table, try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option with repair if you are not totally desperate.",
@@ -211,13 +211,13 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"keys-used", 'k',
    "Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.",
-   (uchar**) &check_param.keys_in_use,
-   (uchar**) &check_param.keys_in_use,
+   &check_param.keys_in_use,
+   &check_param.keys_in_use,
    0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
   {"max-record-length", OPT_MAX_RECORD_LENGTH,
    "Skip rows bigger than this if myisamchk can't allocate memory to hold it",
-   (uchar**) &check_param.max_record_length,
-   (uchar**) &check_param.max_record_length,
+   &check_param.max_record_length,
+   &check_param.max_record_length,
    0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0},
   {"medium-check", 'm',
    "Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
@@ -246,12 +246,12 @@ static struct my_option my_long_options[
 #endif
   {"set-auto-increment", 'A',
    "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
-   (uchar**) &check_param.auto_increment_value,
-   (uchar**) &check_param.auto_increment_value,
+   &check_param.auto_increment_value,
+   &check_param.auto_increment_value,
    0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"set-collation", OPT_SET_COLLATION,
    "Change the collation used by the index",
-   (uchar**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"set-variable", 'O',
    "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -263,12 +263,12 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"sort-records", 'R',
    "Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)",
-   (uchar**) &check_param.opt_sort_key,
-   (uchar**) &check_param.opt_sort_key,
+   &check_param.opt_sort_key,
+   &check_param.opt_sort_key,
    0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"tmpdir", 't',
    "Path for temporary files.",
-   (uchar**) &opt_tmpdir,
+   &opt_tmpdir,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"update-state", 'U',
    "Mark tables as crashed if any errors were found.",
@@ -286,54 +286,54 @@ static struct my_option my_long_options[
    "Wait if table is locked.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   { "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
-    (uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0,
+    &check_param.use_buffers, &check_param.use_buffers, 0,
     GET_ULL, REQUIRED_ARG, USE_BUFFER_INIT, MALLOC_OVERHEAD,
     SIZE_T_MAX, MALLOC_OVERHEAD,  IO_SIZE, 0},
   { "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,  "",
-    (uchar**) &opt_key_cache_block_size,
-    (uchar**) &opt_key_cache_block_size, 0,
+    &opt_key_cache_block_size,
+    &opt_key_cache_block_size, 0,
     GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
     MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
   { "myisam_block_size", OPT_MYISAM_BLOCK_SIZE,  "",
-    (uchar**) &opt_myisam_block_size, (uchar**) &opt_myisam_block_size, 0,
+    &opt_myisam_block_size, &opt_myisam_block_size, 0,
     GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
     MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
   { "read_buffer_size", OPT_READ_BUFFER_SIZE, "",
-    (uchar**) &check_param.read_buffer_length,
-    (uchar**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+    &check_param.read_buffer_length,
+    &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
     (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
     INT_MAX32, (long) MALLOC_OVERHEAD, (long) 1L, 0},
   { "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "",
-    (uchar**) &check_param.write_buffer_length,
-    (uchar**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+    &check_param.write_buffer_length,
+    &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
     (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
     INT_MAX32, (long) MALLOC_OVERHEAD, (long) 1L, 0},
   { "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
-    (uchar**) &check_param.sort_buffer_length,
-    (uchar**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+    &check_param.sort_buffer_length,
+    &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
     (long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
     ULONG_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0},
   { "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "",
-    (uchar**) &check_param.sort_key_blocks,
-    (uchar**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
+    &check_param.sort_key_blocks,
+    &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
     BUFFERS_WHEN_SORTING, 4L, 100L, 0L, 1L, 0},
-  { "decode_bits", OPT_DECODE_BITS, "", (uchar**) &decode_bits,
-    (uchar**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
-  { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (uchar**) &ft_min_word_len,
-    (uchar**) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
+  { "decode_bits", OPT_DECODE_BITS, "", &decode_bits,
+    &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
+  { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", &ft_min_word_len,
+    &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
     0, 1, 0},
-  { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (uchar**) &ft_max_word_len,
-    (uchar**) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
+  { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", &ft_max_word_len,
+    &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
     HA_FT_MAXCHARLEN, 0, 1, 0},
   { "ft_stopword_file", OPT_FT_STOPWORD_FILE,
     "Use stopwords from this file instead of built-in list.",
-    (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR,
+    &ft_stopword_file, &ft_stopword_file, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"stats_method", OPT_STATS_METHOD,
    "Specifies how index statistics collection code should treat NULLs. "
    "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
    "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
-   (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0,
+   &myisam_stats_method_str, &myisam_stats_method_str, 0,
     GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'storage/myisam/myisamlog.c'
--- a/storage/myisam/myisamlog.c	2008-02-18 22:29:39 +0000
+++ b/storage/myisam/myisamlog.c	2010-06-08 19:16:36 +0000
@@ -382,18 +382,18 @@ static int examine_log(char * file_name,
 	       curr_file_info->show_name);
       if (my_b_read(&cache,(uchar*) head,2))
 	goto err;
+      buff= 0;
       file_info.name=0;
       file_info.show_name=0;
       file_info.record=0;
-      if (read_string(&cache,(uchar**) &file_info.name,
-		      (uint) mi_uint2korr(head)))
+      if (read_string(&cache, &buff, (uint) mi_uint2korr(head)))
 	goto err;
       {
 	uint i;
 	char *pos,*to;
 
 	/* Fix if old DOS files to new format */
-	for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++)
+	for (pos=file_info.name=(char*)buff; (pos=strchr(pos,'\\')) ; pos++)
 	  *pos= '/';
 
 	pos=file_info.name;
@@ -692,7 +692,7 @@ static int read_string(IO_CACHE *file, r
     *to= 0;
     DBUG_RETURN(1);
   }
-  *((char*) *to+length)= '\0';
+  *((uchar*) *to+length)= '\0';
   DBUG_RETURN (0);
 }				/* read_string */
 

=== modified file 'storage/myisam/myisampack.c'
--- a/storage/myisam/myisampack.c	2008-11-14 16:29:38 +0000
+++ b/storage/myisam/myisampack.c	2010-06-08 19:16:36 +0000
@@ -257,10 +257,10 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"backup", 'b', "Make a backup of the table as table_name.OLD.",
-   (uchar**) &backup, (uchar**) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &backup, &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR_MP,
-   "Directory where character sets are.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory where character sets are.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f',
@@ -268,7 +268,7 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"join", 'j',
    "Join all given tables into 'new_table_name'. All tables MUST have identical layouts.",
-   (uchar**) &join_table, (uchar**) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &join_table, &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"help", '?', "Display this help and exit.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -282,8 +282,8 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"wait", 'w', "Wait and retry if table is in use.", (uchar**) &opt_wait,
-   (uchar**) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"wait", 'w', "Wait and retry if table is in use.", &opt_wait,
+   &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 

=== modified file 'strings/decimal.c'
--- a/strings/decimal.c	2009-08-28 16:21:54 +0000
+++ b/strings/decimal.c	2010-06-08 19:16:36 +0000
@@ -971,7 +971,7 @@ int decimal2double(decimal_t *from, doub
 
   *to= from->sign ? -result : result;
 
-  DBUG_PRINT("info", ("result: %f (%lx)", *to, *(ulong *)to));
+  DBUG_PRINT("info", ("result: %f", *to));
 
   return E_DEC_OK;
 }

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2010-06-01 11:48:24 +0000
+++ b/tests/mysql_client_test.c	2010-06-08 19:16:36 +0000
@@ -18220,17 +18220,17 @@ static char **defaults_argv;
 
 static struct my_option client_test_long_options[] =
 {
-  {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
-   (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"count", 't', "Number of times test to be executed", (uchar **) &opt_count,
-   (uchar **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
-  {"database", 'D', "Database to use", (uchar **) &opt_db, (uchar **) &opt_db,
+  {"basedir", 'b', "Basedir for tests.", &opt_basedir,
+   &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"count", 't', "Number of times test to be executed", &opt_count,
+   &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
+  {"database", 'D', "Database to use", &opt_db, &opt_db,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
    0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host", (uchar **) &opt_host, (uchar **) &opt_host,
+  {"host", 'h', "Connect to host", &opt_host, &opt_host,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's asked from the tty.",
@@ -18241,8 +18241,7 @@ static struct my_option client_test_long
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar **) &opt_port,
-   (uchar **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_port, &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-arg", 'A', "Send embedded server this as a parameter.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG,
@@ -18251,23 +18250,23 @@ static struct my_option client_test_long
    0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", 'm', "Base name of shared memory.", 
-  (uchar**) &shared_memory_base_name, (uchar**)&shared_memory_base_name, 0, 
+  &shared_memory_base_name, (uchar**)&shared_memory_base_name, 0, 
   GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"socket", 'S', "Socket file to use for connection",
-   (uchar **) &opt_unix_socket, (uchar **) &opt_unix_socket, 0, GET_STR,
+   &opt_unix_socket, &opt_unix_socket, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"testcase", 'c',
    "May disable some code when runs as mysql-test-run testcase.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user", (uchar **) &opt_user,
-   (uchar **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user", &opt_user,
+   &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"vardir", 'v', "Data dir for tests.", (uchar**) &opt_vardir,
-   (uchar**) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"vardir", 'v', "Data dir for tests.", &opt_vardir,
+   &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"getopt-ll-test", 'g', "Option for testing bug in getopt library",
-   (uchar **) &opt_getopt_ll_test, (uchar **) &opt_getopt_ll_test, 0,
+   &opt_getopt_ll_test, &opt_getopt_ll_test, 0,
    GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20100608191636-8xznauh7f3prz6r9.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (davi:3421) Bug#42733Davi Arnaut8 Jun