mariadb/mysql-test/suite
Alfranio Correia 9ba731c299 BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a
transaction
BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW

Before the WL#2687 and BUG#46364, every non-transactional change that happened
after a transactional change was written to trx-cache and flushed upon
committing the transaction. WL#2687 and BUG#46364 changed this behavior and
non-transactional changes are now written to the binary log upon committing
the statement.

A binary log event is identified as transactional or non-transactional through
a flag in the Log_event which is set taking into account the underlie storage
engine on what it is stems from. In the current bug, this flag was not being
set properly when the DROP TEMPORARY TABLE was executed.

However, while fixing this bug we figured out that changes to temporary tables
should be always written to the trx-cache if there is an on-going transaction.
Otherwise, binlog events in the reversed order would be produced.

Regarding concurrency, keeping changes to temporary tables in the trx-cache is
also safe as temporary tables are only visible to the owner connection.

In this patch, we classify the following statements as unsafe:
   1 - INSERT INTO t_myisam SELECT * FROM t_myisam_temp

   2 - INSERT INTO t_myisam_temp SELECT * FROM t_myisam

   3 - CREATE TEMPORARY TABLE t_myisam_temp SELECT * FROM t_myisam

On the other hand, the following statements are classified as safe:

   1 - INSERT INTO t_innodb SELECT * FROM t_myisam_temp

   2 - INSERT INTO t_myisam_temp SELECT * FROM t_innodb

The patch also guarantees that transactions that have a DROP TEMPORARY are
always written to the binary log regardless of the mode and the outcome:
commit or rollback. In particular, the DROP TEMPORARY is extended with the
IF EXISTS clause when the current statement logging format is set to row.

Finally, the patch allows to switch from STATEMENT to MIXED/ROW when there
are temporary tables but the contrary is not possible.
2010-04-20 10:10:43 +01:00
..
binlog BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a 2010-04-20 10:10:43 +01:00
bugs Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY 2009-04-09 16:05:41 +03:00
engines Test suites for engine testing, moved from test-extra so will be available 2010-03-17 23:42:07 -07:00
federated Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-03-07 19:40:59 +03:00
funcs_1 Streamlined funcs_1.storedproc broken by the patch for bug #8433. 2010-03-20 21:34:51 +03:00
funcs_2 merge 5.0-> 5.1 2009-04-24 13:00:17 -04:00
ibmdb2i Bug#49329 example (and other) engines use wrong collation for open tables hash 2009-12-11 12:31:16 +05:30
innodb WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
jp WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
large_tests bug#50296 2010-02-28 19:39:28 +02:00
manual manual merge for bug_29136, bug#29309. 2007-10-13 23:12:50 +03:00
ndb BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a 2010-04-20 10:10:43 +01:00
ndb_team Merge BUG#43263 from 5.0-bugteam to 5.1-bugteam 2009-05-31 13:44:41 +08:00
parts Manual merge of mysql-trunk into mysql-trunk-merge. 2010-03-24 18:03:44 +03:00
perfschema Post-fix for Bug#52444: update test result. 2010-04-15 12:12:03 +04:00
perfschema_stress WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
rpl BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a 2010-04-20 10:10:43 +01:00
rpl_ndb BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a 2010-04-20 10:10:43 +01:00
stress Merge trift2.:/MySQL/M51/mysql-5.1 2008-02-22 16:14:27 +01:00
sys_vars Manual merge. 2010-03-19 11:29:12 +03:00