summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBUILD/SETUP.sh10
-rwxr-xr-xBUILD/build_mccge.sh5
-rw-r--r--client/mysqltest.cc3
-rw-r--r--extra/libevent/devpoll.c2
-rw-r--r--include/thr_lock.h3
-rw-r--r--mysql-test/suite/maria/t/maria3.test2
-rw-r--r--mysql-test/valgrind.supp15
-rw-r--r--mysys/thr_lock.c8
-rw-r--r--sql/lock.cc3
-rw-r--r--storage/xtradb/fil/fil0fil.c2
10 files changed, 40 insertions, 13 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 614312b4236..0f97f265a52 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -98,7 +98,7 @@ SSL_LIBRARY=--with-ssl
if [ "x$warning_mode" != "xpedantic" ]; then
# Both C and C++ warnings
- warnings="-Wall -Wextra -Wunused -Wwrite-strings"
+ warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized"
# For more warnings, uncomment the following line
# warnings="$warnings -Wshadow"
@@ -112,7 +112,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2"
else
- warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
+ warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -Wno-uninitialized -D_POSIX_SOURCE"
c_warnings="$warnings"
cxx_warnings="$warnings -std=c++98"
# NOTE: warning mode should not influence optimize/debug mode.
@@ -127,12 +127,14 @@ fi
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
# LINT_INIT(), which is only useful for silencing spurious warnings
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
-valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
+valgrind_flags="-DHAVE_valgrind -USAFEMALLOC"
+valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
valgrind_configs="--with-valgrind"
#
# Used in -debug builds
-debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
+debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
+debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
error_inject="--with-error-inject "
#
diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh
index 81dbebff32d..72546874b0f 100755
--- a/BUILD/build_mccge.sh
+++ b/BUILD/build_mccge.sh
@@ -1063,7 +1063,7 @@ set_warning_flags()
warnings="$warnings -Wcomment -W"
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label"
- warnings="$warnings -Wunused-value -Wunused-variable"
+ warnings="$warnings -Wunused-value -Wunused-variable -Wno-uninitialized"
if test "x$warning_mode" = "extra" ; then
warnings="$warnings -Wshadow"
@@ -1094,7 +1094,8 @@ set_with_debug_flags()
{
if test "x$with_debug_flag" = "xyes" ; then
if test "x$developer_flag" = "xyes" ; then
- loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
+ loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
+ loc_debug_flags="$loc_debug_flags -Wuninitialized -DFORCE_INIT_OF_VARS"
loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
compiler_flags="$compiler_flags $loc_debug_flags"
fi
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 680efebcfaf..308dbaea426 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -3071,8 +3071,7 @@ void do_remove_files_wildcard(struct st_command *command)
if (ds_wild.length &&
wild_compare(file->name, ds_wild.str, 0))
continue;
- ds_file_to_remove.length= ds_directory.length + 1;
- ds_file_to_remove.str[ds_directory.length + 1]= 0;
+ ds_file_to_remove.length= ds_directory.length;
dynstr_append(&ds_file_to_remove, file->name);
DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
if ((error= (my_delete(ds_file_to_remove.str, MYF(MY_WME)) != 0)))
diff --git a/extra/libevent/devpoll.c b/extra/libevent/devpoll.c
index 82427c9e229..3a3ec7e64a8 100644
--- a/extra/libevent/devpoll.c
+++ b/extra/libevent/devpoll.c
@@ -185,7 +185,7 @@ devpoll_init(struct event_base *base)
}
static int
-devpoll_recalc(struct event_base *base, void *arg, int max)
+devpoll_recalc(struct event_base *base __attribute__((unused)), void *arg, int max)
{
struct devpollop *devpollop = arg;
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 08cc8bd5408..111fd5f4cf2 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -123,7 +123,7 @@ typedef struct st_thr_lock_data {
struct st_thr_lock *lock;
pthread_cond_t *cond;
void *status_param; /* Param to status functions */
- void *debug_print_param;
+ void *debug_print_param; /* Used by MariaDB for TABLE ref */
enum thr_lock_type type;
uint priority;
} THR_LOCK_DATA;
@@ -149,6 +149,7 @@ typedef struct st_thr_lock {
my_bool (*start_trans)(void*); /* When all locks are taken */
my_bool (*check_status)(void *);
void (*fix_status)(void *, void *);/* For thr_merge_locks() */
+ const char *name; /* Used for error reporting */
my_bool allow_multiple_concurrent_insert;
} THR_LOCK;
diff --git a/mysql-test/suite/maria/t/maria3.test b/mysql-test/suite/maria/t/maria3.test
index f2ae5d73fb2..a6dd0ca6639 100644
--- a/mysql-test/suite/maria/t/maria3.test
+++ b/mysql-test/suite/maria/t/maria3.test
@@ -172,11 +172,13 @@ create table t1 (a bigint auto_increment, primary key(a), b char(255), c varchar
let $1=1000;
--disable_query_log
--disable_warnings
+lock tables t1 write;
while ($1)
{
insert into t1 () values();
dec $1;
}
+unlock tables;
--enable_query_log
update t1 set b=repeat('a',100) where a between 1 and 100;
check table t1;
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 67179571953..de009eab1fa 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -489,6 +489,21 @@
}
{
+ dlsym memory loss from plugin on SuSE 11.1 x64
+ Memcheck:Leak
+ fun:*alloc
+ obj:/lib*/ld-*.so
+ obj:/lib*/ld-*.so
+ obj:/lib*/ld-*.so
+ obj:/lib*/libc-*.so
+ obj:/lib*/libdl-*.so
+ obj:/lib*/ld-*.so
+ obj:/lib*/libdl-*.so
+ fun:dlsym
+ fun:*plugin_dl_add*
+}
+
+{
dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 32/64 bit ver 1
Memcheck:Leak
fun:*alloc
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 68a3caf6da7..f7908ab57bc 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -182,8 +182,10 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
last_lock_type != TL_WRITE_CONCURRENT_INSERT)
{
fprintf(stderr,
- "Warning: Found locks from different threads in %s at '%s'. org_lock_type: %d last_lock_type: %d new_lock_type: %d\n",
- lock_type, where, list->data->type, last_lock_type, data->type);
+ "Warning: Found locks from different threads for lock '%s' in '%s' at '%s'. org_lock_type: %d last_lock_type: %d new_lock_type: %d\n",
+ data->lock->name ? data->lock->name : "",
+ lock_type, where, list->data->type, last_lock_type,
+ data->type);
return 1;
}
if (no_cond && data->cond)
@@ -405,6 +407,7 @@ void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, void *param)
data->status_param=param;
data->cond=0;
data->priority= 0;
+ data->debug_print_param= 0;
}
@@ -879,6 +882,7 @@ void thr_unlock(THR_LOCK_DATA *data, uint unlock_flags)
data->type=TL_UNLOCK; /* Mark unlocked */
check_locks(lock,"after releasing lock",1);
wake_up_waiters(lock);
+ check_locks(lock,"end of thr_unlock",1);
pthread_mutex_unlock(&lock->mutex);
DBUG_VOID_RETURN;
}
diff --git a/sql/lock.cc b/sql/lock.cc
index e5ea85e7ce7..c59ec0e90e2 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -923,7 +923,10 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
*to++= table;
if (locks)
for ( ; org_locks != locks ; org_locks++)
+ {
(*org_locks)->debug_print_param= (void *) table;
+ (*org_locks)->lock->name= table->alias;
+ }
}
/*
We do not use 'tables', because there are cases where store_lock()
diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c
index cae91d4037c..8e043f1f7e2 100644
--- a/storage/xtradb/fil/fil0fil.c
+++ b/storage/xtradb/fil/fil0fil.c
@@ -3313,7 +3313,7 @@ skip_info:
}
if (page_is_corrupt) {
- fprintf(stderr, " [errp:%lld]", offset / UNIV_PAGE_SIZE);
+ fprintf(stderr, " [errp:%ld]", (long) (offset / UNIV_PAGE_SIZE));
/* cannot treat corrupt page */
goto skip_write;