| 1 |
# |
| 2 |
# Initialize |
| 3 |
# |
| 4 |
SET @@global.binlog_expire_logs_seconds = 1; |
| 5 |
RESET MASTER; |
| 6 |
FLUSH BINARY LOGS; |
| 7 |
FLUSH BINARY LOGS; |
| 8 |
# |
| 9 |
# Lock instance for backup |
| 10 |
# |
| 11 |
[connection con1] |
| 12 |
LOCK INSTANCE FOR BACKUP; |
| 13 |
# |
| 14 |
# Flush binary logs so binary logs are purged |
| 15 |
# |
| 16 |
[connection default] |
| 17 |
include/save_error_log_position.inc |
| 18 |
FLUSH BINARY LOGS; |
| 19 |
# |
| 20 |
# Check that binary logs have not been purged |
| 21 |
# |
| 22 |
include/assert_error_log.inc [server: 1, pattern: Could not purge binary logs since another session is executing LOCK INSTANCE FOR BACKUP. Wait for that session to release the lock.] |
| 23 |
# |
| 24 |
# Unlock instance |
| 25 |
# |
| 26 |
[connection con1] |
| 27 |
UNLOCK INSTANCE; |
| 28 |
# |
| 29 |
# Generate log purge |
| 30 |
# |
| 31 |
[connection default] |
| 32 |
include/save_error_log_position.inc |
| 33 |
FLUSH BINARY LOGS; |
| 34 |
# |
| 35 |
# Check relay logs have been purged |
| 36 |
# |
| 37 |
include/assert_error_log.inc [server: 1, pattern: NONE] |
| 38 |
# |
| 39 |
# Cleanup |
| 40 |
# |
| 41 |
SET @@global.binlog_expire_logs_seconds = BINLOG_EXPIRE_LOGS_SECONDS_SAVED; |