List:Commits« Previous MessageNext Message »
From:kpettersson Date:April 16 2008 4:25pm
Subject:bk commit into 5.1 tree (thek:1.2590) BUG#34417
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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-16 18:25:37+02:00, thek@adventure.(none) +1 -0
  Bug#34417 Assertion failure in Diagnostics_area::set_error_status()
  
  The Diagnostic_area caused an assertion failure in debug mode when
  the disk was full.
  
  By setting the internal error handler to ignore errors caused by
  underlying logging methods, the error is avoided.

  sql/log.cc@stripped, 2008-04-16 18:25:34+02:00, thek@adventure.(none) +13 -3
    MYSQL_QUERY_LOG::write uses IOCACHE for writing data. If writing fails 
    an error is pushed by the procedure my_error which in turn invokes
    the default error handler my_message_sql. When the error is set the
    Diagnostic_area status changes which later triggers an assertion on the
    next consecutive status change which happens by for example the 
    function my_ok().

diff -Nrup a/sql/log.cc b/sql/log.cc
--- a/sql/log.cc	2008-03-27 12:54:43 +01:00
+++ b/sql/log.cc	2008-04-16 18:25:34 +02:00
@@ -2011,9 +2011,11 @@ bool MYSQL_QUERY_LOG::write(time_t event
   char local_time_buff[MAX_TIME_SIZE];
   struct tm start;
   uint time_buff_len= 0;
+  THD *thd= current_thd;
 
   (void) pthread_mutex_lock(&LOCK_log);
-
+  Silence_log_table_errors error_handler;
+  thd->push_internal_handler(&error_handler);
   /* Test if someone closed between the is_open test and lock */
   if (is_open())
   {
@@ -2058,6 +2060,7 @@ bool MYSQL_QUERY_LOG::write(time_t event
       goto err;
   }
 
+  thd->pop_internal_handler();
   (void) pthread_mutex_unlock(&LOCK_log);
   return FALSE;
 err:
@@ -2067,6 +2070,7 @@ err:
     write_error= 1;
     sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
   }
+  thd->pop_internal_handler();
   (void) pthread_mutex_unlock(&LOCK_log);
   return TRUE;
 }
@@ -2111,9 +2115,11 @@ bool MYSQL_QUERY_LOG::write(THD *thd, ti
   DBUG_ENTER("MYSQL_QUERY_LOG::write");
 
   (void) pthread_mutex_lock(&LOCK_log);
-
+  Silence_log_table_errors error_handler;
+  thd->push_internal_handler(&error_handler);
   if (!is_open())
   {
+    thd->pop_internal_handler();
     (void) pthread_mutex_unlock(&LOCK_log);
     DBUG_RETURN(0);
   }
@@ -2223,6 +2229,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, ti
       }
     }
   }
+  thd->pop_internal_handler();
   (void) pthread_mutex_unlock(&LOCK_log);
   DBUG_RETURN(error);
 }
@@ -4029,7 +4036,8 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_C
 {
   DBUG_ENTER("MYSQL_BIN_LOG::write(THD *, IO_CACHE *, Log_event *)");
   VOID(pthread_mutex_lock(&LOCK_log));
-
+  Silence_log_table_errors error_handler;
+  thd->push_internal_handler(&error_handler);
   /* NULL would represent nothing to replicate after ROLLBACK */
   DBUG_ASSERT(commit_event != NULL);
 
@@ -4114,6 +4122,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_C
     else
       rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
   }
+  thd->pop_internal_handler();
   VOID(pthread_mutex_unlock(&LOCK_log));
 
   DBUG_RETURN(0);
@@ -4124,6 +4133,7 @@ err:
     write_error= 1;
     sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
   }
+  thd->pop_internal_handler();
   VOID(pthread_mutex_unlock(&LOCK_log));
   DBUG_RETURN(1);
 }
Thread
bk commit into 5.1 tree (thek:1.2590) BUG#34417kpettersson16 Apr