[Commits] Rev 3362: Fixed bug mdev-463. in file:///home/igor/maria/maria-5.5-mdev463/

Igor Babaev igor at askmonty.org
Mon Aug 20 22:05:38 EEST 2012


At file:///home/igor/maria/maria-5.5-mdev463/

------------------------------------------------------------
revno: 3362
revision-id: igor at askmonty.org-20120820190537-epzo04x3o58ccj6i
parent: igor at askmonty.org-20120819051846-7ygh43o2rnfods3h
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5-mdev463
timestamp: Mon 2012-08-20 12:05:37 -0700
message:
  Fixed bug mdev-463.
  RBR should be turned off when an ANALYZE TABLE command is executed.
-------------- next part --------------
=== added file 'mysql-test/r/stat_tables_rbr.result'
--- a/mysql-test/r/stat_tables_rbr.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/stat_tables_rbr.result	2012-08-20 19:05:37 +0000
@@ -0,0 +1,10 @@
+#
+# Bug mdev-463: assertion failure when running ANALYZE with RBR on
+# 
+SET GLOBAL use_stat_tables = PREFERABLY;
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+ANALYZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	status	OK
+DROP TABLE t1;
+SET GLOBAL use_stat_tables = DEFAULT;

=== added file 'mysql-test/t/stat_tables_rbr.test'
--- a/mysql-test/t/stat_tables_rbr.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/stat_tables_rbr.test	2012-08-20 19:05:37 +0000
@@ -0,0 +1,18 @@
+--source include/have_binlog_format_row.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug mdev-463: assertion failure when running ANALYZE with RBR on
+--echo # 
+
+SET GLOBAL use_stat_tables = PREFERABLY;
+
+--connect (con1,localhost,root,,)
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+ANALYZE TABLE t1;
+
+# Cleanup
+DROP TABLE t1;
+SET GLOBAL use_stat_tables = DEFAULT;
+--disconnect con1
+

=== modified file 'sql/sql_admin.cc'
--- a/sql/sql_admin.cc	2012-08-18 18:49:14 +0000
+++ b/sql/sql_admin.cc	2012-08-20 19:05:37 +0000
@@ -322,6 +322,8 @@
   int result_code;
   int compl_result_code;
   bool need_repair_or_alter= 0;
+  bool save_binlog_row_based= 0;
+
   DBUG_ENTER("mysql_admin_table");
   DBUG_PRINT("enter", ("extra_open_options: %u", extra_open_options));
 
@@ -415,6 +417,11 @@
         */
 
         open_error= open_and_lock_tables(thd, table, TRUE, 0);
+        if (lex->sql_command == SQLCOM_ANALYZE)
+	{
+          if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
+            thd->clear_current_stmt_binlog_format_row();
+        }
       }
       thd->prepare_derived_at_open= FALSE;
 
@@ -954,6 +961,8 @@
     trans_commit_stmt(thd);
     trans_commit_implicit(thd);
     close_thread_tables(thd);
+    if (save_binlog_row_based)
+      thd->set_current_stmt_binlog_format_row();
     thd->mdl_context.release_transactional_locks();
 
     /*
@@ -986,6 +995,8 @@
   trans_rollback_stmt(thd);
   trans_rollback(thd);
   close_thread_tables(thd);			// Shouldn't be needed
+  if (save_binlog_row_based)
+    thd->set_current_stmt_binlog_format_row();
   thd->mdl_context.release_transactional_locks();
   if (table)
     table->table=0;



More information about the commits mailing list