Commit 5fe4a51c authored by Michael Widenius's avatar Michael Widenius

Fixed lp:884101 "Crash in check_table_is_closed with concurrent workload"

storage/myisam/mi_dbug.c:
  Added mutex to protect open table list while traversing it
parent 6c27730a
...@@ -173,6 +173,7 @@ my_bool check_table_is_closed(const char *name, const char *where) ...@@ -173,6 +173,7 @@ my_bool check_table_is_closed(const char *name, const char *where)
DBUG_ENTER("check_table_is_closed"); DBUG_ENTER("check_table_is_closed");
(void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32); (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32);
pthread_mutex_lock(&THR_LOCK_myisam);
for (pos=myisam_open_list ; pos ; pos=pos->next) for (pos=myisam_open_list ; pos ; pos=pos->next)
{ {
MI_INFO *info=(MI_INFO*) pos->data; MI_INFO *info=(MI_INFO*) pos->data;
...@@ -183,10 +184,12 @@ my_bool check_table_is_closed(const char *name, const char *where) ...@@ -183,10 +184,12 @@ my_bool check_table_is_closed(const char *name, const char *where)
{ {
fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where); fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where);
DBUG_PRINT("warning",("Table: %s is open on %s", name,where)); DBUG_PRINT("warning",("Table: %s is open on %s", name,where));
pthread_mutex_unlock(&THR_LOCK_myisam);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
} }
} }
pthread_mutex_unlock(&THR_LOCK_myisam);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#endif /* EXTRA_DEBUG */ #endif /* EXTRA_DEBUG */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment