File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # Test BACKUP STAGES BLOCK_COMMIT with binary logging on
3
+ #
4
+ SET BINLOG_FORMAT=MIXED;
5
+ RESET MASTER;
6
+ create table t1 (a int) engine=aria;
7
+ insert into t1 values (1);
8
+ BACKUP STAGE START;
9
+ BACKUP STAGE BLOCK_COMMIT;
10
+ SELECT @@gtid_binlog_pos;
11
+ @@gtid_binlog_pos
12
+ 0-1-2
13
+ BACKUP STAGE END;
14
+ include/show_binlog_events.inc
15
+ Log_name Pos Event_type Server_id End_log_pos Info
16
+ master-bin.000001 # Gtid # # GTID #-#-#
17
+ master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=aria
18
+ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
19
+ master-bin.000001 # Query # # use `test`; insert into t1 values (1)
20
+ master-bin.000001 # Query # # COMMIT
21
+ drop table t1;
Original file line number Diff line number Diff line change
1
+ --source include/have_log_bin.inc
2
+ --source include/have_binlog_format_mixed.inc
3
+
4
+ --echo #
5
+ --echo # Test BACKUP STAGES BLOCK_COMMIT with binary logging on
6
+ --echo #
7
+
8
+ SET BINLOG_FORMAT=MIXED;
9
+ RESET MASTER;
10
+
11
+ create table t1 (a int) engine=aria;
12
+ insert into t1 values (1);
13
+
14
+ BACKUP STAGE START;
15
+ BACKUP STAGE BLOCK_COMMIT;
16
+ SELECT @@gtid_binlog_pos;
17
+ BACKUP STAGE END;
18
+ source include/show_binlog_events.inc;
19
+ drop table t1;
Original file line number Diff line number Diff line change @@ -290,6 +290,14 @@ static bool backup_block_commit(THD *thd)
290
290
291
291
/* We can ignore errors from flush_tables () */
292
292
(void ) flush_tables (thd, FLUSH_SYS_TABLES);
293
+
294
+ if (mysql_bin_log.is_open ())
295
+ {
296
+ mysql_mutex_lock (mysql_bin_log.get_log_lock ());
297
+ mysql_file_sync (mysql_bin_log.get_log_file ()->file ,
298
+ MYF (MY_WME|MY_SYNC_FILESIZE));
299
+ mysql_mutex_unlock (mysql_bin_log.get_log_lock ());
300
+ }
293
301
thd->clear_error ();
294
302
295
303
DBUG_RETURN (0 );
You can’t perform that action at this time.
0 commit comments