Skip to content

Commit b0e4b0d

Browse files
committed
Bug#36423593 Purging ndb_binlog_index affects ndb binlog
Follow up fix for mismatched result due to file path separators. Change-Id: Iec5b01659e12840f30748beb81dbed2dd33471b6
1 parent f722f64 commit b0e4b0d

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

mysql-test/suite/ndb_binlog/r/ndb_binlog_purge_orphans.result

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ SHOW VARIABLES LIKE 'ndb_log_bin';
55
Variable_name Value
66
ndb_log_bin ON
77
RESET MASTER;
8+
# Find physical binlog file name format as it varies between platforms
9+
CREATE TABLE check_binlog_name (a int primary key) engine = NDB;
10+
INSERT INTO check_binlog_name VALUES (1);
11+
DROP TABLE check_binlog_name;
12+
RESET MASTER;
813
# 1. Insert to create referencing rows
914
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=ndb;
1015
INSERT INTO t1 VALUES (1);
@@ -60,23 +65,23 @@ Test.000001
6065
/home/a/b/c/d/e/f/Test.000004
6166
c:\Progra~1\WinAmp\Skins\Test.000005
6267
./Test.000006/
63-
./binlog.000001
64-
./binlog.000002
65-
./binlog.000003
66-
./binlog.000006
67-
./binlog.000007
68-
./binlog.000008
69-
./binlog.000009
70-
./binlog.000010
68+
binlog.000001
69+
binlog.000002
70+
binlog.000003
71+
binlog.000006
72+
binlog.000007
73+
binlog.000008
74+
binlog.000009
75+
binlog.000010
7176
# 6. Restart
7277
# restart
7378
# 7. Wait for 5 rows
7479
# 8. Show that referenced rows are still there
7580
SELECT DISTINCT(File) FROM mysql.ndb_binlog_index;
7681
File
77-
./binlog.000006
78-
./binlog.000007
79-
./binlog.000008
80-
./binlog.000009
81-
./binlog.000010
82+
binlog.000006
83+
binlog.000007
84+
binlog.000008
85+
binlog.000009
86+
binlog.000010
8287
RESET MASTER;

mysql-test/suite/ndb_binlog/t/ndb_binlog_purge_orphans.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ SHOW VARIABLES LIKE 'ndb_log_bin';
2727

2828
RESET MASTER;
2929

30+
--echo # Find physical binlog file name format as it varies between platforms
31+
CREATE TABLE check_binlog_name (a int primary key) engine = NDB;
32+
INSERT INTO check_binlog_name VALUES (1);
33+
DROP TABLE check_binlog_name;
34+
let $binlog_name =
35+
`SELECT SUBSTRING(File, 1, LENGTH(File)-LENGTH('.000001'))
36+
FROM mysql.ndb_binlog_index ORDER BY epoch LIMIT 1`;
37+
#echo binlog_name: $binlog_name;
38+
39+
RESET MASTER;
40+
3041
--echo # 1. Insert to create referencing rows
3142
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=ndb;
3243
let $i = 1;
@@ -65,6 +76,7 @@ insert into mysql.ndb_binlog_index values
6576
(9, './Test.000006/', 27, 0, 0, 0, 0, 0, 0, 0, 0, 'Next file');
6677

6778
--source include/show_binary_logs.inc
79+
--replace_result $binlog_name binlog
6880
SELECT DISTINCT(File) FROM mysql.ndb_binlog_index;
6981

7082
--echo # 6. Restart
@@ -78,6 +90,7 @@ let $wait_condition=
7890
--source include/wait_condition.inc
7991

8092
--echo # 8. Show that referenced rows are still there
93+
--replace_result $binlog_name binlog
8194
SELECT DISTINCT(File) FROM mysql.ndb_binlog_index;
8295

8396
RESET MASTER;

0 commit comments

Comments
 (0)