Redundant GTID unsafe mark for CREATE/DROP TEMPORARY TABLE in RBR/MBR

Bug #1711781 reported by Nickolay Ihalainen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Laurynas Biveinis
5.7
Fix Released
Medium
Laurynas Biveinis

Bug Description

Temporary tables are not logged in binlog for RBR after:
https://bugs.launchpad.net/percona-server/+bug/1668602

This makes tests passing for: https://bugs.mysql.com/bug.php?id=77354
even with:

@@ -11005,7 +11005,8 @@ bool THD::is_ddl_gtid_compatible()
GTID even if the transaction is rolled back.
This includes the execution inside Functions and Triggers.
*/
- if (in_multi_stmt_transaction_mode() || in_sub_stmt)
+ if ((in_multi_stmt_transaction_mode() || in_sub_stmt)
+ && !is_current_stmt_binlog_format_row())

Patch provided by customer fixes forever-opened Hibernate bug related to gtid and temporary tables inside transactions:
https://hibernate.atlassian.net/browse/HHH-9289

The bug is not applicable for upstream, because
https://bugs.mysql.com/bug.php?id=85258 still not applied

Revision history for this message
Nickolay Ihalainen (ihanick) wrote :

Test case:
docker run --name p7 --rm -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -it percona:5.7.18 --server-id=51 --log-bin=mysql-bin --gtid_mode=off --log-slave-updates

create database test;
use test
set global log_bin_trust_function_creators=1;
delimiter //
CREATE FUNCTION `test_func` () RETURNS varchar(30) CHARSET utf8
BEGIN
    DROP TEMPORARY TABLE IF EXISTS test_func_1;
    DROP TEMPORARY TABLE IF EXISTS test_func_2;
    DROP TEMPORARY TABLE IF EXISTS test_func_3;
    DROP TEMPORARY TABLE IF EXISTS test_func_4;
    RETURN "hello";
END//
delimiter ;
SELECT test_func();
show binlog events in 'mysql-bin.000003';

drop temporary table statement is not logged (compare to PS <= 5.7.17 & upstream <= 5.7.19

tags: added: merge-reg
tags: added: merge-regression
removed: merge-reg
summary: - is no need in marking create/drop temporary table unsafe for gtid
- (introduced in mysql-bug):77354 after lp:1668602
+ redundant GTID unsafe mark for create/drop temporary table after
+ lp:1668602
summary: - redundant GTID unsafe mark for create/drop temporary table after
- lp:1668602
+ Redundant GTID unsafe mark for CREATE/DROP TEMPORARY TABLE in RBR/MBR
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
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-1816

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.