List:Commits« Previous MessageNext Message »
From:Kristofer Pettersson Date:September 10 2008 11:51am
Subject:bzr commit into mysql-5.1 branch (kpettersson:2729)
View as plain text  
#At file:///home/thek/Development/cpp/mysqlbzr/mysql-5.1-bug38692/

 2729 Kristofer Pettersson	2008-09-10
      Bug38692: concurrent inserts cause valgrind errors in Query_cache::invalidate
      
      If a delayed insert thread was aborted by a concurrent 'truncate table'
      statement, then the diagnostic area would fail with an assert in a debug build
      because no actual error message was pushed on the stack despite a thread
      being killed.
      
      This patch adds an error message to the stack.
      
      
      * Changed sql_print_error() to my_error() to avoid assertion in the DA
      * Added assertion in "should never happen" branch.
modified:
  sql/sql_insert.cc

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2008-07-11 18:51:10 +0000
+++ b/sql/sql_insert.cc	2008-09-10 11:50:35 +0000
@@ -2532,8 +2532,14 @@ bool Delayed_insert::handle_inserts(void
   thd_proc_info(&thd, "upgrading lock");
   if (thr_upgrade_write_delay_lock(*thd.lock->locks))
   {
-    /* This can only happen if thread is killed by shutdown */
-    sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->s->table_name.str);
+    /*
+      This can happen if thread is killed either by a shutdown
+      or if another thread is removing the current table definition
+      from the table cache.
+    */
+    
+    my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
+             table->s->table_name.str);
     goto err;
   }
 
@@ -2691,6 +2697,7 @@ bool Delayed_insert::handle_inserts(void
 	  /* This should never happen */
 	  sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),
                           table->s->table_name.str);
+    DBUG_ASSERT(0);
 	}
 	if (!using_bin_log)
 	  table->file->extra(HA_EXTRA_WRITE_CACHE);

Thread
bzr commit into mysql-5.1 branch (kpettersson:2729) Kristofer Pettersson10 Sep
  • Re: bzr commit into mysql-5.1 branch (kpettersson:2729)Konstantin Osipov10 Sep