List:Commits« Previous MessageNext Message »
From:kpettersson Date:April 10 2008 3:02pm
Subject:bk commit into 6.0 tree (thek:1.2605) BUG#34895
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of thek.  When thek does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-04-10 17:02:14+02:00, thek@adventure.(none) +2 -0
  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.

  sql/sql_yacc.yy@stripped, 2008-04-10 17:02:09+02:00, thek@adventure.(none) +0 -4
    Since the I_S mechanism is already handling the open and close of 
    mysql.proc there is no need for the method sp_add_to_query_tables.

  storage/myisam/mi_dbug.c@stripped, 2008-04-10 17:02:09+02:00, thek@adventure.(none) +4 -0
    check_table_is_closed is only used in EXTRA_DEBUG mode but since it is
    iterating over myisam shared data it still needs to be protected by an
    appropriate mutex.

diff -Nrup a/sql/sql_yacc.yy b/sql/sql_yacc.yy
--- a/sql/sql_yacc.yy	2008-03-12 12:26:07 +01:00
+++ b/sql/sql_yacc.yy	2008-04-10 17:02:09 +02:00
@@ -9572,8 +9572,6 @@ show_param:
           {
             LEX *lex= Lex;
             lex->sql_command= SQLCOM_SHOW_STATUS_PROC;
-            if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
-              MYSQL_YYABORT;
             if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
               MYSQL_YYABORT;
           }
@@ -9581,8 +9579,6 @@ show_param:
           {
             LEX *lex= Lex;
             lex->sql_command= SQLCOM_SHOW_STATUS_FUNC;
-            if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
-              MYSQL_YYABORT;
             if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
               MYSQL_YYABORT;
           }
diff -Nrup a/storage/myisam/mi_dbug.c b/storage/myisam/mi_dbug.c
--- a/storage/myisam/mi_dbug.c	2006-12-31 01:06:39 +01:00
+++ b/storage/myisam/mi_dbug.c	2008-04-10 17:02:09 +02:00
@@ -172,6 +172,8 @@ my_bool check_table_is_closed(const char
   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)
   {
@@ -183,10 +185,12 @@ my_bool check_table_is_closed(const char
       {
 	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 */
Thread
bk commit into 6.0 tree (thek:1.2605) BUG#34895kpettersson10 Apr