@@ -45,31 +45,10 @@ RESET MASTER;
45
45
CREATE TABLE t1 (a int);
46
46
47
47
-- echo ### assertion: index file contains regular entries
48
- -- replace_regex /[\\\/].*master/ MYSQLD_DATADIR\/master/
48
+ -- replace_result $datadir MYSQLD_DATADIR
49
49
-- eval SET @index=LOAD_FILE('$index')
50
- if (`SELECT convert(@@version_compile_os using latin1)
51
- IN ('Win32','Win64','Windows')`)
52
- {
53
- -- disable_query_log
54
- -- disable_result_log
55
- -- let $a= `SELECT REPLACE (@index, '$datadir\', '')`
56
- -- enable_result_log
57
- -- enable_query_log
58
-
59
- -- echo $a
60
-
61
- }
62
- if (!`SELECT convert(@@version_compile_os using latin1)
63
- IN ('Win32','Win64','Windows')`)
64
- {
65
- -- disable_query_log
66
- -- disable_result_log
67
- -- let $a= `SELECT REPLACE (@index, '$datadir/', '')`
68
- -- enable_result_log
69
- -- enable_query_log
70
-
71
- -- echo $a
72
- }
50
+ -- replace_result $datadir MYSQLD_DATADIR
51
+ SELECT @index;
73
52
74
53
--echo ### assertion: show original binlogs
75
54
-- source include/show_binary_logs.inc
@@ -79,49 +58,34 @@ if (!`SELECT convert(@@version_compile_os using latin1)
79
58
80
59
# action: copy binlogs to other names and change entries in index file
81
60
-- copy_file $datadir/master-bin.000001 $datadir/master-bin-b34582.000001
82
- -- let newbinfile=$datadir/master-bin-b34582.000001
83
- let INDEX_FILE=$index;
61
+ -- let newbinfile= $datadir/master-bin-b34582.000001
62
+ -- let INDEX_FILE= $index
84
63
perl;
85
- $newbinfile= $ENV{'newbinfile'};
64
+ use File::Spec;
65
+ $newbinfile= File::Spec->rel2abs($ENV{'newbinfile'});
86
66
$file= $ENV{'INDEX_FILE'};
87
67
open(FILE, ">$file") || die "Unable to open $file.";
88
68
truncate(FILE,0);
89
- print FILE $newbinfile . "\n ";
69
+ print FILE " $newbinfile";
90
70
close ($file);
91
71
EOF
92
72
73
+ # append a new line (platform independent)
74
+ -- append_file $index
75
+
76
+ EOF
77
+
93
78
# action: should cause rotation, and creation of new binlogs
94
79
FLUSH LOGS;
95
80
96
81
# file is not used anymore - remove it (mysql closed on flush logs).
97
82
-- remove_file $datadir/master-bin.000001
98
83
99
84
-- echo ### assertion: index file contains renamed binlog and the new one
100
- -- replace_regex /[\\\/].*master/ MYSQLD_DATADIR\/master/
85
+ -- replace_result $datadir MYSQLD_DATADIR
101
86
-- eval SET @index=LOAD_FILE('$index')
102
- if (`SELECT convert(@@version_compile_os using latin1)
103
- IN ('Win32','Win64','Windows')`)
104
- {
105
- -- disable_query_log
106
- -- disable_result_log
107
- -- let $a= `SELECT REPLACE (@index, '$datadir\', '')`
108
- -- enable_result_log
109
- -- enable_query_log
110
-
111
- -- echo $a
112
-
113
- }
114
- if (!`SELECT convert(@@version_compile_os using latin1)
115
- IN ('Win32','Win64','Windows')`)
116
- {
117
- -- disable_query_log
118
- -- disable_result_log
119
- -- let $a= `SELECT REPLACE (@index, '$datadir/', '')`
120
- -- enable_result_log
121
- -- enable_query_log
122
-
123
- -- echo $a
124
- }
87
+ -- replace_result $datadir MYSQLD_DATADIR
88
+ SELECT @index;
125
89
126
90
-- echo ### assertion: original binlog content still exists, despite we
127
91
-- echo ### renamed and changed the index file
@@ -147,30 +111,9 @@ DROP TABLE t1;
147
111
-- file_exists $datadir/$current_binlog
148
112
149
113
-- echo ### assertion: show index file contents and these should match show binary logs issued above
150
- -- replace_regex /[\\\/].*master/ MYSQLD_DATADIR\/master/
114
+ -- replace_result $datadir MYSQLD_DATADIR
151
115
-- eval SET @index=LOAD_FILE('$index')
152
- if (`SELECT convert(@@version_compile_os using latin1)
153
- IN ('Win32','Win64','Windows')`)
154
- {
155
- -- disable_query_log
156
- -- disable_result_log
157
- -- let $a= `SELECT REPLACE (@index, '$datadir\', '')`
158
- -- enable_result_log
159
- -- enable_query_log
160
-
161
- -- echo $a
162
-
163
- }
164
- if (!`SELECT convert(@@version_compile_os using latin1)
165
- IN ('Win32','Win64','Windows')`)
166
- {
167
- -- disable_query_log
168
- -- disable_result_log
169
- -- let $a= `SELECT REPLACE (@index, '$datadir/', '')`
170
- -- enable_result_log
171
- -- enable_query_log
172
-
173
- -- echo $a
174
- }
116
+ -- replace_result $datadir MYSQLD_DATADIR
117
+ SELECT @index;
175
118
176
119
RESET MASTER;
0 commit comments