diff options
-rw-r--r-- | mysys/my_getopt.c | 10 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index e57c1d71a13..ceb99975cdb 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -414,11 +414,17 @@ invalid value '%s'", (optp->var_type & GET_TYPE_MASK) == GET_ENUM)) { if (optend == disabled_my_option) - *((my_bool*) value)= (my_bool) 0; + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) + *((my_bool*) value)= (my_bool) 0; + else + *((ulong*) value)= (ulong) 0; else { if (!optend) /* No argument -> enable option */ - *((my_bool*) value)= (my_bool) 1; + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) + *((my_bool*) value)= (my_bool) 1; + else + *((ulong*) value)= (ulong) 1; else argument= optend; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 65d86b1bc74..fa19d7188bf 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2980,12 +2980,12 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, Allocate temporary space for the value of the tristate. This option will have a limited lifetime and is not used beyond server initialization. - GET_ENUM value is an integer. + GET_ENUM value is an ulong. */ options[0].value= options[1].value= (uchar **)alloc_root(mem_root, - sizeof(int)); - *((uint*) options[0].value)= *((uint*) options[1].value)= - (uint) options[0].def_value; + sizeof(ulong)); + *((ulong*) options[0].value)= *((ulong*) options[1].value)= + (ulong) options[0].def_value; options+= 2; @@ -3269,7 +3269,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, Set plugin loading policy from option value. First element in the option list is always the <plugin name> option value. */ - plugin_load_policy= (enum_plugin_load_policy)*(uint*)opts[0].value; + plugin_load_policy= (enum_plugin_load_policy)*(ulong*)opts[0].value; } disable_plugin= (plugin_load_policy == PLUGIN_OFF); |