From 03db11cfdaabc27b57de342eb4974195745f90d6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Sep 2009 15:05:02 +0200 Subject: MBug#423035: error in parsing enum value for plugin variable in mysqld command-line option Fix parsing of invalid plugin enum option value. Previous patch to fix plugin enum option parsing on big-endian introduced another bug due to incorrect comparison of unsigned value. This would cause an incorrect value to be parsed as value 0. See also MySQL Bug#41010 and Bug#32034. mysql-test/mysql-test-run.pl: Add a facility for test case to run the mysqld binary (to test that invalid startup options are rejected correctly). mysql-test/r/mysqld_option_err.result: Add a test case to check that invalid startup options for mysqld are rejected. This is needed to test MBug#423035. Also add a few other similar tests, as this was completely untested before this patch. mysql-test/t/mysqld_option_err.test: Add a test case to check that invalid startup options for mysqld are rejected. This is needed to test MBug#423035. Also add a few other similar tests, as this was completely untested before this patch. mysys/my_getopt.c: Fix parsing of invalid plugin enum option value. --- mysys/my_getopt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 0de80b01c4f..d44ec162b93 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -603,6 +603,7 @@ static int setval(const struct my_option *opts, uchar* *value, char *argument, my_bool set_maximum_value) { int err= 0; + int pos; if (value && argument) { @@ -647,7 +648,9 @@ static int setval(const struct my_option *opts, uchar* *value, char *argument, return EXIT_OUT_OF_MEMORY; break; case GET_ENUM: - if (((*(ulong *)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0) + pos= find_type(argument, opts->typelib, 2) - 1; + (*(ulong *)result_pos)= pos; + if (pos < 0) return EXIT_ARGUMENT_INVALID; break; case GET_SET: -- cgit v1.2.1 From 592379fc9592821b4acb65f3694b517f22621af4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Sep 2009 15:20:22 +0200 Subject: Fix most Compiler warnings seen in buildbot. Add suppressions for a few warnings that cannot be meaningfully fixed by MariaDB developers. Changes for XtraDB, PBXT, and YaSSL also submitted upstream. Also add a `ccfilter` wrapper that can be used to filter out suppressed warnings in a local build (to check that new warnings are not introduced). client/mysqlbinlog.cc: Fix compiler warnings. config/ac-macros/misc.m4: Fix wrong naming, autoconfig requires _cv_ in cached names. extra/yassl/include/yassl_int.hpp: Fix compiler warnings. extra/yassl/src/handshake.cpp: Fix compiler warnings. extra/yassl/src/yassl_imp.cpp: Fix compiler warnings. extra/yassl/src/yassl_int.cpp: Fix compiler warnings. extra/yassl/taocrypt/include/modes.hpp: Fix compiler warnings. extra/yassl/taocrypt/src/asn.cpp: Fix compiler warnings. mysys/my_compress.c: Fix compiler warnings. sql/mysqld.cc: Fix compiler warnings. sql/strfunc.cc: Fix compiler warnings. storage/pbxt/src/discover_xt.cc: Fix compiler warnings. storage/xtradb/fil/fil0fil.c: Fix compiler warnings. storage/xtradb/mtr/mtr0mtr.c: Fix compiler warnings. storage/xtradb/srv/srv0srv.c: Fix compiler warnings. storage/xtradb/srv/srv0start.c: Fix compiler warnings. strings/decimal.c: Fix compiler warnings. support-files/ccfilter: Add helper for suppressing compiler warnings in local developer source tree. Allows to check for not introducing new warnings into Buildbot without having to actually run the build through Buildbot. support-files/compiler_warnings.supp: Suppress a few warnings that cannot be meaningfully fixed in source code. --- mysys/my_compress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mysys') diff --git a/mysys/my_compress.c b/mysys/my_compress.c index 26626d70079..ade2742c4fc 100644 --- a/mysys/my_compress.c +++ b/mysys/my_compress.c @@ -81,12 +81,13 @@ my_bool my_compress(uchar *packet, size_t *len, size_t *complen) This fix is safe, since such memory is only used internally by zlib, so we will not hide any bugs in mysql this way. */ -void *my_az_allocator(void *dummy, unsigned int items, unsigned int size) +void *my_az_allocator(void *dummy __attribute__((unused)), unsigned int items, + unsigned int size) { return my_malloc((size_t)items*(size_t)size, IF_VALGRIND(MY_ZEROFILL, MYF(0))); } -void my_az_free(void *dummy, void *address) +void my_az_free(void *dummy __attribute__((unused)), void *address) { my_free(address, MYF(MY_ALLOW_ZERO_PTR)); } -- cgit v1.2.1