Commit 39d05031 authored by unknown's avatar unknown

Portability fixes

Fix bug when using option groups


libmysql/libmysql.c:
  Fix bug when using option groups
myisam/myisamchk.c:
  Portability fix
mysys/my_getopt.c:
  Portability fix
parent 8b1b90dd
...@@ -737,7 +737,7 @@ static void mysql_read_default_options(struct st_mysql_options *options, ...@@ -737,7 +737,7 @@ static void mysql_read_default_options(struct st_mysql_options *options,
*end=0; /* Remove '=' */ *end=0; /* Remove '=' */
} }
/* Change all '_' in variable name to '-' */ /* Change all '_' in variable name to '-' */
for (end= *option ; (end= strcend(end,'_')) && *end ; ) for (end= *option ; *(end= strcend(end,'_')) ; )
*end= '-'; *end= '-';
switch (find_type(*option+2,&option_types,2)) { switch (find_type(*option+2,&option_types,2)) {
case 1: /* port */ case 1: /* port */
......
...@@ -193,7 +193,7 @@ static struct my_option my_long_options[] = ...@@ -193,7 +193,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 'i', 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 'i', 0, 0, 0, 0, 0, 0},
{"keys-used", "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!", {"keys-used", "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!",
(gptr*) &check_param.keys_in_use, (gptr*) &check_param.keys_in_use, 0, (gptr*) &check_param.keys_in_use, (gptr*) &check_param.keys_in_use, 0,
GET_LL, REQUIRED_ARG, 'k', -1LL, 0, 0, 0, 0, 0}, GET_LL, REQUIRED_ARG, 'k',-1, 0, 0, 0, 0, 0},
{"medium-check", {"medium-check",
"Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases.", 0, 0, 0, GET_NO_ARG, NO_ARG, 'm', 0, 0, 0, 0, 0, "Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases.", 0, 0, 0, GET_NO_ARG, NO_ARG, 'm', 0, 0, 0, 0, 0,
0}, 0},
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_config.h>
#include <my_global.h> #include <my_global.h>
#include <m_string.h> #include <m_string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -452,7 +451,7 @@ static void init_variables(const struct my_option *options) ...@@ -452,7 +451,7 @@ static void init_variables(const struct my_option *options)
{ {
if (options->var_type == GET_LONG) if (options->var_type == GET_LONG)
*((long*) options->u_max_value)= *((long*) options->value)= *((long*) options->u_max_value)= *((long*) options->value)=
options->def_value; (long) options->def_value;
else if (options->var_type == GET_LL) else if (options->var_type == GET_LL)
*((longlong*) options->u_max_value)= *((longlong*) options->value)= *((longlong*) options->u_max_value)= *((longlong*) options->value)=
options->def_value; options->def_value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment