144
140
my $sql_grammar = $storage."/bughunt_sql.yy";
145
141
copy($config->grammar, $sql_grammar)
146
142
or croak("File " . $config->grammar . " cannot be copied to " . $sql_grammar );
147
my $data_grammar = "";
148
143
if ( defined $config->gendata ) {
149
$data_grammar = $storage."/bughunt_data.zz";
144
my $data_grammar = $storage."/bughunt_data.yy";
150
145
copy($config->gendata, $data_grammar)
151
146
or croak("File " . $config->gendata . " cannot be copied to " . $data_grammar );
152
147
$rqgoptions = $rqgoptions . " --gendata=" . $data_grammar;
154
my $redefine_grammar = "";
155
if ( defined $config->redefine ) {
156
$redefine_grammar = $storage."/bughunt_sql_redefine.yy";
157
copy($config->redefine, $redefine_grammar)
158
or croak("File " . $config->redefine . " cannot be copied to " . $redefine_grammar );
159
$rqgoptions = $rqgoptions . " --redefine=" . $redefine_grammar;
162
# Some bugs can be investigating using the core file and the server binary.
163
# Make a copy of the server binary.
164
# Attention: In the moment we do not use the copy during testing like the grammars.
165
# FIXME: There is at least one more location where the "mysqld" binary might be stored.
166
copy($config->basedir.'/sql/mysqld', $storage.'/mysqld');
167
$rqgoptions = $rqgoptions . " --basedir=" . $config->basedir;
169
150
my $good_seed = $config->initial_seed;
170
151
my $mask_level = $config->mask_level;
197
178
my $runall_status = system($runall);
198
179
$runall_status = $runall_status >> 8;
200
if ($runall_status == STATUS_UNKNOWN_ERROR) {
201
say("runall_status = $runall_status");
202
say("Maybe the server startup options are wrong.");
204
exit STATUS_UNKNOWN_ERROR;
208
181
my $end_time = Time::HiRes::time();
209
182
my $duration = $end_time - $start_time;
228
201
checkLogForPattern();
230
203
# Save storage space by deleting the log of a non important run.
231
if ($preserve_log == 0) {
232
unlink($current_rqg_log)
234
# Backup vardir, the grammars and the mysqld binary
235
# Attention: There might be warnings about missing grammar files
236
# Sleep a bit with the intention to avoid that the archiver comes up with a
237
# warning like "<vardir>/master-data/ib_logfile1: File changed during reading
239
my $save_cmd = 'tar czf ' . $storage . '/' . $trial . '.tgz ' . $vardir . ' ' . $current_rqg_log . ' ' . $sql_grammar . ' ' . $data_grammar . ' ' . $redefine_grammar . ' ' . $storage.'/mysqld' ;
240
say("save_cmd: ->$save_cmd<-");
241
my $save_vardir = system($save_cmd);
242
# FIXME: Abort in case the call to tar fails
204
if ($preserve_log == 0) { unlink($current_rqg_log) };
247
207
#############################