Restore MySQL 5.6.10 change for "15847447"

Bug #1350386 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Laurynas Biveinis
5.6
Fix Released
High
Laurynas Biveinis

Bug Description

A combination of a revert of MariaDB rpl_mdev382 fix and a fix for https://bugs.launchpad.net/percona-server/+bug/1277351 still results in the following testcase difference:

+++ /Users/laurynas/percona/lp-mysql-server/bug1208371/obj-debug/mysql-test/var/log/rpl_mdev382.reject 2014-07-30 17:08:39.000000000 +0300
@@ -318,9 +318,7 @@
 # The DELETE statement should be correctly quoted
 include/show_binlog_events.inc
 Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query # # BEGIN
 master-bin.000002 # Query # # use `test`; DELETE FROM `db1``; select 'oops!'`.`t``1`
-master-bin.000002 # Query # # COMMIT
 include/start_slave.inc
 # The table should be empty on the slave also.

i.e. different binlogging for a MEMORY table replication reset upon master server restart.

Source code shows that this difference is due to upstream setting direct = TRUE and PS w/ MariaDB fix direct = FALSE for

      if (thd->binlog_query(THD::STMT_QUERY_TYPE,
                            temp_buf.c_ptr_safe(), temp_buf.length(),
                            FALSE, /* direct arg here */, FALSE, errcode))

in open_table_entry_fini of sql_base.cc.

Thus PS has effectively reverted the upstream revision [1] released in 5.6.10. We mismerged it, partly because it was lacking a testcase.

A revert of MariaDB fix will fix this, with a testcase re-record.

[1]

$ bzr log -r 4591.1.77
------------------------------------------------------------
revno: 4591.1.77
committer: Ahmad Abdullateef<email address hidden>
branch nick: mysql-5.6-bug15847447
timestamp: Mon 2012-11-26 18:52:00 +0530
message:
  BUG#15847447 - THD->TRANSACTION.STMT.IS_EMPTY()
                 || (THD->STATE_FLAGS & OPEN_TABLES_STATE::BACKU

  DESCRIPTION:
  When a view is based on a Heap (In memory) backed table and this
  Table is altered to drop some field which was in use by the view, then
  a SELECT on this view results in an ASSETION failure when the server
  is started with Bin-Log enabled.

  ANALYSIS :
  The triggered assert in open_normal_and_derived_tables() checks that
  the current statement transaction is empty if something fails during
  opening of tables and handling of derived tables. This makes sure that
  there is nothing that the statement has done that needs to be rolled
  back at this point.

  The reason that the assert is triggered in this case is that a
  statement transaction is started by THD::binlog_query() during
  open_tables() -> open_table_entry_fini() if we are opening a
  HEAP table for the first time, subsequently mysql_handle_derived()
  fails while processing the view since a column has disappeared.

  FIX :
  During implicit_emptied processing in the call to THD::binlog_query() direct
  is set to TRUE, as a result the event is immediately written to the log bypassing
  a transaction, hence the assert is not triggered.

Related branches

tags: added: merge-regression
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-806

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.