Skip to content

Commit 59dd63d

Browse files
Pekka NousiainenPiotr Obrzut
authored andcommitted
wl#7614 worker-state1.diff
fix require() in worker stop (cherry picked from commit de71dbcb7d289a3cd0e405d0c79a3771bdb7ff28)
1 parent 7b4a7f0 commit 59dd63d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

mysql-test/suite/ndb/t/ndb_import.pl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ sub run_import {
285285
my $fter = $test->{csvfmt}{fields_terminated_by};
286286
my $fenc = $test->{csvfmt}{fields_enclosed_by};
287287
my @cmd = ();
288-
push(@cmd, "--exec");
289288
push(@cmd, "\$NDB_IMPORT");
290289
push(@cmd, "--state-dir='$test->{statedir}'");
291290
push(@cmd, "--input-type=csv");
@@ -305,15 +304,21 @@ sub run_import {
305304
if ($opts->{resume}) {
306305
push(@cmd, "--resume");
307306
}
307+
push(@cmd, "--verbose=1");
308308
push(@cmd, $test->{database});
309309
my $tables = $test->{tables};
310310
for my $table (@$tables) {
311311
my $csvfile = get_csvfile($test, $table, $opts);
312312
push(@cmd, $csvfile);
313313
}
314314
# runs mainly on unix/linux so stderr goes to stdout
315-
push(@cmd, ">>\$NDB_TOOLS_OUTPUT 2>&1");
316-
return "@cmd\n";
315+
my $log = '>>$NDB_TOOLS_OUTPUT 2>&1';
316+
my @cmd1 = ("--exec", "echo", @cmd, $log);
317+
my @cmd2 = ("--exec", @cmd, $log);
318+
if (defined($opts->{error})) {
319+
unshift(@cmd2, "--error $opts->{error}\n");
320+
}
321+
return "@cmd1\n@cmd2\n";
317322
}
318323

319324
sub select_count {
@@ -410,11 +415,9 @@ sub make_test {
410415
if (!$test->{resume}) {
411416
push @txt, run_import($test, {});
412417
} else {
413-
push @txt, "--error 1\n";
414-
push @txt, run_import($test, {});
418+
push @txt, run_import($test, { error => "1" });
415419
for (my $i = 1; $i <= $test->{rejects}; $i++) {
416-
push @txt, "--error 0,1\n";
417-
push @txt, run_import($test, { resume => $i });
420+
push @txt, run_import($test, { resume => $i, error => "0,1" });
418421
}
419422
}
420423
push @txt, select_counts($test, {});

storage/ndb/tools/NdbImportImpl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,12 @@ NdbImportImpl::Team::stop_worker(Worker* w)
10271027
w->m_dostop = true;
10281028
w->signal();
10291029
break;
1030+
case WorkerState::State_stop:
1031+
/*
1032+
* Worker is about to stop, allow it to do so. It is either
1033+
* ready or it is reacting to m_dostop.
1034+
*/
1035+
break;
10301036
case WorkerState::State_stopped:
10311037
break;
10321038
default:

0 commit comments

Comments
 (0)