From: Date: October 6 2008 2:13pm Subject: bzr commit into mysql-5.1 branch (kpettersson:2730) Bug#38692 List-Archive: http://lists.mysql.com/commits/55443 X-Bug: 38692 Message-Id: <20081006121340.AFA8A5300BC@Adventure> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/thek/Development/cpp/mysqlbzr/mysql-5.1-bug38692/ 2730 Kristofer Pettersson 2008-10-06 Bug#38692 concurrent inserts cause valgrind errors in Query_cache::invalidate Concurrent inserts produce valgrind error messages. The reason is that the query cache is invalidated after the target table object is closed. By executing query cache invalidation before the delayed insert thread is terminated avoids this issue. modified: sql/sql_insert.cc per-file messages: sql/sql_insert.cc Executing end_delayed_insert will invalidate the elements in table_list. Hence query_cache_invalidate3 must be called before this function since it iterates the table_list. === modified file 'sql/sql_insert.cc' --- a/sql/sql_insert.cc 2008-09-10 14:58:03 +0000 +++ b/sql/sql_insert.cc 2008-10-06 12:13:25 +0000 @@ -825,12 +825,12 @@ bool mysql_insert(THD *thd,TABLE_LIST *t #ifndef EMBEDDED_LIBRARY if (lock_type == TL_WRITE_DELAYED) { + query_cache_invalidate3(thd, table_list, 1); if (!error) { info.copied=values_list.elements; end_delayed_insert(thd); } - query_cache_invalidate3(thd, table_list, 1); } else #endif