MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:June 7 2010 12:05pm
Subject:bzr commit into mysql-trunk-runtime branch (kostja:3041) Bug#52432
View as plain text  
#At file:///opt/local/work/trunk-runtime/ based on revid:dlenev@stripped

 3041 Konstantin Osipov	2010-06-07
      A fix for Bug#52432 "Crash in check_table_is_closed on an 
      information_schema query.
      Porting a fix done for a feature tree by Ingo Struewing.
      No test case since the crash only occurs under a stress
      load.
     @ storage/myisam/mi_dbug.c
        Iterate over the list of MyISAM shares and access the MyISAM 
        share internals under a lock.

    modified:
      storage/myisam/mi_dbug.c
=== modified file 'storage/myisam/mi_dbug.c'
--- a/storage/myisam/mi_dbug.c	2009-11-24 13:54:59 +0000
+++ b/storage/myisam/mi_dbug.c	2010-06-07 12:05:34 +0000
@@ -164,7 +164,19 @@ void _mi_print_key(FILE *stream, registe
 } /* print_key */
 
 
-#ifdef EXTRA_DEBUG 
+#ifdef EXTRA_DEBUG
+/**
+  Check if the named table is in the open list.
+
+  @param[in]    name    table path as in MYISAM_SHARE::unique_file_name
+  @param[in]    where   verbal description of caller
+
+  @retval       TRUE    table is in open list
+  @retval       FALSE   table is not in open list
+
+  @note This function takes THR_LOCK_myisam. Do not call it when
+  this mutex is locked by this thread already.
+*/
 
 my_bool check_table_is_closed(const char *name, const char *where)
 {
@@ -173,6 +185,7 @@ my_bool check_table_is_closed(const char
   DBUG_ENTER("check_table_is_closed");
 
   (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32);
+  mysql_mutex_lock(&THR_LOCK_myisam);
   for (pos=myisam_open_list ; pos ; pos=pos->next)
   {
     MI_INFO *info=(MI_INFO*) pos->data;
@@ -181,12 +194,14 @@ my_bool check_table_is_closed(const char
     {
       if (share->last_version)
       {
+        mysql_mutex_unlock(&THR_LOCK_myisam);
 	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);
       }
     }
   }
+  mysql_mutex_unlock(&THR_LOCK_myisam);
   DBUG_RETURN(0);
 }
 #endif /* EXTRA_DEBUG */


Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20100607120534-szm27dxhvkj2jkh6.bundle
Thread
bzr commit into mysql-trunk-runtime branch (kostja:3041) Bug#52432Konstantin Osipov7 Jun