summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-12-10 17:04:09 +0200
committerMichael Widenius <monty@askmonty.org>2010-12-10 17:04:09 +0200
commit84edaac4f14b2fbaf57fef8fbaeb45966b1feda3 (patch)
tree63051b8c7027a17b6857c32ed31ac0734d8e1a2b
parent1bbb55a2603f3571585cc085f05149d3d9cdbdba (diff)
downloadmariadb-git-84edaac4f14b2fbaf57fef8fbaeb45966b1feda3.tar.gz
Better warning message if lock test fails
Made archive.test a bit more safe mysql-test/r/archive.result: Added removal of files to make rerun of failed test work mysql-test/t/archive.test: Added removal of files to make rerun of failed test work mysys/thr_lock.c: Better warning message if lock test fails
-rw-r--r--mysql-test/r/archive.result1
-rw-r--r--mysql-test/t/archive.test5
-rw-r--r--mysys/thr_lock.c10
3 files changed, 10 insertions, 6 deletions
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 5a731e6476c..ae79e237ade 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12717,6 +12717,7 @@ COUNT(t1.a)
729
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
+flush tables;
SHOW CREATE TABLE t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 7478c7dcdce..c966b51d861 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1630,6 +1630,11 @@ SET @@join_buffer_size= @save_join_buffer_size;
# BUG#47012 archive tables are not upgradeable, and server crashes on any access
#
let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+# Remove files to handle possible restart of test
+flush tables;
+remove_files_wildcard $MYSQLD_DATADIR/test t1.*;
+
copy_file std_data/bug47012.frm $MYSQLD_DATADIR/test/t1.frm;
copy_file std_data/bug47012.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
copy_file std_data/bug47012.ARM $MYSQLD_DATADIR/test/t1.ARM;
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 341b2f0058e..60214c9af08 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -158,15 +158,13 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
{
THR_LOCK_DATA *data,**prev;
uint count=0;
- THR_LOCK_OWNER *UNINIT_VAR(first_owner);
prev= &list->data;
if (list->data)
{
- enum thr_lock_type last_lock_type=list->data->type;
+ enum thr_lock_type last_lock_type= list->data->type;
+ THR_LOCK_OWNER first_owner= list->data->owner;
- if (same_owner && list->data)
- first_owner= list->data->owner;
for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next)
{
if (data->type != last_lock_type)
@@ -184,8 +182,8 @@ 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: %s\n",
- lock_type,where);
+ "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);
return 1;
}
if (no_cond && data->cond)