summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-09-30 14:50:25 +0200
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-09-30 14:50:25 +0200
commitf7ebdaef80ff6a015b048af9b1df5c45fb683e8f (patch)
treeefcfb36538355adb5c4b8b5f66dad98a7206308f /myisam
parent869c011218b43552ab4e43335cecda5685e04229 (diff)
downloadmariadb-git-f7ebdaef80ff6a015b048af9b1df5c45fb683e8f.tar.gz
Bug#34895 'show procedure status' or 'show function status' +
'flush tables' crashes The server crashes when 'show procedure status' and 'flush tables' are run concurrently. This is caused by the way mysql.proc table is added twice to the list of table to lock although the requirements on the current locking API assumes differently. No test case is submitted because of the nature of the crash which is currently difficult to reproduce in a deterministic way. This is a backport from 5.1
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_dbug.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/myisam/mi_dbug.c b/myisam/mi_dbug.c
index 07c314c43e6..111cae13344 100644
--- a/myisam/mi_dbug.c
+++ b/myisam/mi_dbug.c
@@ -171,7 +171,7 @@ my_bool check_table_is_closed(const char *name, const char *where)
char filename[FN_REFLEN];
LIST *pos;
DBUG_ENTER("check_table_is_closed");
-
+ pthread_mutex_lock(&THR_LOCK_myisam);
(void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32);
for (pos=myisam_open_list ; pos ; pos=pos->next)
{
@@ -181,12 +181,14 @@ my_bool check_table_is_closed(const char *name, const char *where)
{
if (share->last_version)
{
- fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where);
- DBUG_PRINT("warning",("Table: %s is open on %s", name,where));
- DBUG_RETURN(1);
+ fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where);
+ DBUG_PRINT("warning",("Table: %s is open on %s", name,where));
+ pthread_mutex_unlock(&THR_LOCK_myisam);
+ DBUG_RETURN(1);
}
}
}
+ pthread_mutex_unlock(&THR_LOCK_myisam);
DBUG_RETURN(0);
}
#endif /* EXTRA_DEBUG */