| 1 |
RESET MASTER; |
| 2 |
CREATE TABLE t1 (a int); |
| 3 |
### assertion: index file contains regular entries |
| 4 |
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index'); |
| 5 |
SELECT @index; |
| 6 |
@index |
| 7 |
binlog.000001 |
| 8 |
|
| 9 |
### assertion: show original binlogs |
| 10 |
show binary logs; |
| 11 |
Log_name File_size Encrypted |
| 12 |
binlog.000001 # # |
| 13 |
### assertion: binlog contents from regular entries |
| 14 |
include/show_binlog_events.inc |
| 15 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 16 |
binlog.000001 # Query # # use `test`; CREATE TABLE t1 (a int) |
| 17 |
FLUSH LOGS; |
| 18 |
### assertion: index file contains renamed binlog and the new one |
| 19 |
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index'); |
| 20 |
SELECT @index; |
| 21 |
@index |
| 22 |
binlog-b34582.000001 |
| 23 |
binlog.000002 |
| 24 |
|
| 25 |
### assertion: original binlog content still exists, despite we |
| 26 |
### renamed and changed the index file |
| 27 |
include/show_binlog_events.inc |
| 28 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 29 |
binlog-b34582.000001 # Query # # use `test`; CREATE TABLE t1 (a int) |
| 30 |
### assertion: user changed binlog index shows correct entries |
| 31 |
show binary logs; |
| 32 |
Log_name File_size Encrypted |
| 33 |
binlog-b34582.000001 # # |
| 34 |
binlog.000002 # # |
| 35 |
DROP TABLE t1; |
| 36 |
### assertion: purging binlogs up to binlog created after instrumenting index file should work |
| 37 |
PURGE BINARY LOGS TO 'binlog.000002'; |
| 38 |
### assertion: show binary logs should only contain latest binlog |
| 39 |
show binary logs; |
| 40 |
Log_name File_size Encrypted |
| 41 |
binlog.000002 # # |
| 42 |
### assertion: assert that binlog files were indeed purged (using file_exists calls) |
| 43 |
### assertion: assert that not purged binlog file exists |
| 44 |
### assertion: show index file contents and these should match show binary logs issued above |
| 45 |
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index'); |
| 46 |
SELECT @index; |
| 47 |
@index |
| 48 |
binlog.000002 |
| 49 |
|
| 50 |
RESET MASTER; |