Debian Codegraph @

mysql-test/suite/binlog/r/binlog_delete_and_flush_index.result

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