List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:April 4 2011 2:21pm
Subject:bzr push into mysql-trunk-innodb branch (vasil.dimov:3559 to 3560)
View as plain text  
 3560 Vasil Dimov	2011-04-04
      Fix Bug 11933790 - INNODB ASSERTS TRX->IN_MYSQL_TRX_LIST IN ANALYZE WITH
      PERSISTENT STATS
      
      Use trx_rollback_to_savepoint() for internal transactions in persistent
      stats code instead of trx_rollback_for_mysql(). The assertion that a
      trx which is passed to trx_rollback_for_mysql() should be in mysql list
      was added recently.
      
      Reviewed by:	Marko (rb://638)

    added:
      mysql-test/suite/innodb/r/innodb_bug11933790.result
      mysql-test/suite/innodb/t/innodb_bug11933790.test
    modified:
      storage/innobase/dict/dict0stats.c
 3559 Sunny Bains	2011-04-04
      General code cleanup. Rename functions, factor out the prefetch init to
      a separate function, fold the separate mallocs into one. This is part of
      making the pre-fetch configurable via the optimizer in the future.
      
      Approved by Marko rb://641

    modified:
      storage/innobase/row/row0mysql.c
      storage/innobase/row/row0sel.c
=== added file 'mysql-test/suite/innodb/r/innodb_bug11933790.result'
--- a/mysql-test/suite/innodb/r/innodb_bug11933790.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug11933790.result	revid:vasil.dimov@stripped
@@ -0,0 +1,4 @@
+call mtr.add_suppression("InnoDB: Error while trying to save table statistics for table .+bug11933790: Lock wait timeout");
+ANALYZE TABLE bug11933790;
+Table	Op	Msg_type	Msg_text
+test.bug11933790	analyze	status	Operation failed

=== added file 'mysql-test/suite/innodb/t/innodb_bug11933790.test'
--- a/mysql-test/suite/innodb/t/innodb_bug11933790.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug11933790.test	revid:vasil.dimov@stripped
@@ -0,0 +1,48 @@
+#
+# Bug 11933790 - INNODB ASSERTS TRX->IN_MYSQL_TRX_LIST IN ANALYZE WITH
+# PERSISTENT STATS
+#
+
+-- source include/have_innodb.inc
+-- source suite/innodb/include/innodb_stats_bootstrap.inc
+
+call mtr.add_suppression("InnoDB: Error while trying to save table statistics for table .+bug11933790: Lock wait timeout");
+
+# we are only interested that the below commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+SET SESSION innodb_analyze_is_persistent=1;
+
+CREATE TABLE bug11933790 (c INT) ENGINE=INNODB;
+
+# add some records to innodb.table_stats
+ANALYZE TABLE bug11933790;
+
+SET autocommit=0;
+
+# lock the records in innodb.table_stats
+SELECT * FROM innodb.table_stats FOR UPDATE;
+
+-- connect (con1,localhost,root,,)
+
+-- connection con1
+
+SET SESSION innodb_analyze_is_persistent=1;
+
+# this will fail with lock wait timeout; if the bug is present then mysqld
+# crashes here
+-- enable_query_log
+-- enable_result_log
+ANALYZE TABLE bug11933790;
+-- disable_query_log
+-- disable_result_log
+
+-- connection default
+
+-- disconnect con1
+
+COMMIT;
+
+DROP TABLE bug11933790;
+DROP DATABASE innodb;

=== modified file 'storage/innobase/dict/dict0stats.c'
--- a/storage/innobase/dict/dict0stats.c	revid:sunny.bains@stripped
+++ b/storage/innobase/dict/dict0stats.c	revid:vasil.dimov@stripped
@@ -44,7 +44,7 @@ Created Jan 06, 2010 Vasil Dimov
 #include "row0sel.h" /* sel_node_struct */
 #include "row0types.h" /* sel_node_t */
 #include "trx0trx.h" /* trx_create() */
-#include "trx0roll.h" /* trx_rollback_for_mysql() */
+#include "trx0roll.h" /* trx_rollback_to_savepoint() */
 #include "usr0types.h" /* sess_t */
 #include "ut0rnd.h" /* ut_rnd_interval() */
 
@@ -1659,7 +1659,10 @@ dict_stats_save(
 
 end_rollback:
 
-	trx_rollback_for_mysql(trx);
+	trx->op_info = "rollback of internal transaction on stats tables";
+	trx_rollback_to_savepoint(trx, NULL);
+	trx->op_info = "";
+	ut_a(trx->error_state == DB_SUCCESS);
 
 end_free:
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-innodb branch (vasil.dimov:3559 to 3560) vasil.dimov4 Apr