summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-11-13 10:30:56 +0000
committerLuis Soares <luis.soares@sun.com>2009-11-13 10:30:56 +0000
commit9c23a442b257c0ddb9066930c7bf9b0aac6cacdd (patch)
tree87582e8b743ed5f91a10c87333a5797edb45a7f3 /mysql-test/r
parentb31c544eec7e66bf64b45d1ae3b11e11ed537142 (diff)
downloadmariadb-git-9c23a442b257c0ddb9066930c7bf9b0aac6cacdd.tar.gz
BUG#48738: Backport patch for Bug 34582 to 5.0 codebase.
From BUG 34582 commit message: Issuing 'FLUSH LOGS' does not close and reopen indexfile. Instead a SEEK_SET is performed. This patch makes index file to be closed and reopened whenever a rotation happens (FLUSH LOGS is issued or binary log exceeds maximum configured size).
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/binlog_delete_and_flush_index.result44
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/binlog_delete_and_flush_index.result b/mysql-test/r/binlog_delete_and_flush_index.result
new file mode 100644
index 00000000000..153900f3081
--- /dev/null
+++ b/mysql-test/r/binlog_delete_and_flush_index.result
@@ -0,0 +1,44 @@
+RESET MASTER;
+CREATE TABLE t1 (a int);
+### assertion: index file contains regular entries
+SET @index=LOAD_FILE('MYSQLD_DATADIR/master-bin.index');
+master-bin.000001
+
+### assertion: show original binlogs
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+### assertion: binlog contents from regular entries
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
+FLUSH LOGS;
+### assertion: index file contains renamed binlog and the new one
+SET @index=LOAD_FILE('MYSQLD_DATADIR/master-bin.index');
+master-bin-b34582.000001
+master-bin.000002
+
+### assertion: original binlog content still exists, despite we
+### renamed and changed the index file
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin-b34582.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
+### assertion: user changed binlog index shows correct entries
+show binary logs;
+Log_name File_size
+master-bin-b34582.000001 #
+master-bin.000002 #
+DROP TABLE t1;
+### assertion: purging binlogs up to binlog created after instrumenting index file should work
+PURGE BINARY LOGS TO 'master-bin.000002';
+### assertion: show binary logs should only contain latest binlog
+show binary logs;
+Log_name File_size
+master-bin.000002 #
+### assertion: assert that binlog files were indeed purged (using file_exists calls)
+### assertion: assert that not purged binlog file exists
+### assertion: show index file contents and these should match show binary logs issued above
+SET @index=LOAD_FILE('MYSQLD_DATADIR/master-bin.index');
+master-bin.000002
+
+RESET MASTER;