diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-08-04 15:58:09 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-08-04 15:58:09 +0300 |
commit | b1a8b3aa6eb3f8f8c2df218e4eb25e4af710b66a (patch) | |
tree | 6d1cee70a8b083af4c8fb88a8fc9091d6e1e051e | |
parent | 5eeb6488cf3973c3821aef10d40ed221985f9190 (diff) | |
download | mariadb-git-b1a8b3aa6eb3f8f8c2df218e4eb25e4af710b66a.tar.gz |
Bug #42144: plugin_load fails
Reverted the ulong->uint diff
Re-applied the first diff.
The original commit message follows:
enum plugin system variables are ulong internally, not int.
On systems where long is not the same as an int it causes
problems.
Fixed by correct typecasting. Removed the test from the
experimental list.
-rw-r--r-- | include/mysql/plugin.h | 2 | ||||
-rw-r--r-- | mysys/my_getopt.c | 10 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 8 | ||||
-rw-r--r-- | storage/example/ha_example.cc | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index c2ca8a0f94e..55ef6070f85 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -318,7 +318,7 @@ DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \ #name, comment, check, update, &varname, def, min, max, blk } #define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned int) = { \ +DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \ PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \ #name, comment, check, update, &varname, def, typelib } diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 6ed4189a69a..0327db33e98 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -664,13 +664,13 @@ static int setval(const struct my_option *opts, void *value, char *argument, Accept an integer representation of the enumerated item. */ char *endptr; - uint arg= (uint) strtoul(argument, &endptr, 10); + ulong arg= strtoul(argument, &endptr, 10); if (*endptr || arg >= opts->typelib->count) return EXIT_ARGUMENT_INVALID; - *(uint*)result_pos= arg; + *((ulong*) result_pos)= arg; } else - *(uint*)result_pos= type - 1; + *((ulong*) result_pos)= type - 1; } break; case GET_SET: @@ -1008,7 +1008,7 @@ static void init_one_value(const struct my_option *option, void *variable, *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL); break; case GET_ENUM: - *((uint*) variable)= (uint) value; + *((ulong*) variable)= (ulong) value; break; case GET_UINT: *((uint*) variable)= (uint) getopt_ull_limit_value((uint) value, option, NULL); @@ -1248,7 +1248,7 @@ void my_print_variables(const struct my_option *options) } break; case GET_ENUM: - printf("%s\n", get_type(optp->typelib, *(uint*) value)); + printf("%s\n", get_type(optp->typelib, *(ulong*) value)); break; case GET_STR: case GET_STR_ALLOC: /* fall through */ diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 6eed702e5ec..a5640f5d80c 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -3030,12 +3030,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 unsigned integer. + GET_ENUM value is a unsigned long integer. */ options[0].value= options[1].value= (uchar **)alloc_root(mem_root, - sizeof(uint)); - *((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; diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 402be70efab..2a4fe538c85 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -848,7 +848,7 @@ int ha_example::create(const char *name, TABLE *table_arg, struct st_mysql_storage_engine example_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; -static uint srv_enum_var= 0; +static ulong srv_enum_var= 0; static ulong srv_ulong_var= 0; const char *enum_var_names[]= |