2
# This program is free software; you can redistribute it and/or modify
3
# it under the terms of the GNU General Public License as published by
4
# the Free Software Foundation; version 2 of the License.
6
# This program is distributed in the hope that it will be useful, but
7
# WITHOUT ANY WARRANTY; without even the implied warranty of
8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9
# General Public License for more details.
11
# You should have received a copy of the GNU General Public License
12
# along with this program; if not, write to the Free Software
13
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
17
package GenTest::SimPipe::Oracle::TwiceSporadic;
20
@ISA = qw(GenTest::SimPipe::Oracle GenTest);
26
use GenTest::SimPipe::Oracle;
27
use GenTest::Constants;
28
use GenTest::Executor;
29
use GenTest::Comparator;
34
my ($oracle, $testcase) = @_;
36
my $executor = GenTest::Executor->newFromDSN($oracle->dsn());
39
my $dbh = $executor->dbh();
41
my $testcase_string = join("\n", (
42
"CREATE DATABASE IF NOT EXISTS sporadic$$;",
44
$testcase->mysqldOptionsToString(),
45
$testcase->dbObjectsToString()
48
open (LD, '>/tmp/last_dump.test');
49
print LD $testcase_string;
52
$dbh->do($testcase_string, { RaiseError => 1 , mysql_multi_statements => 1 });
54
$testcase_string .= "\n".join(";\n", @{$testcase->queries()}).";\n";
56
$executor->execute($testcase->queries()->[0]);
59
$executor->execute($testcase->queries()->[1]."/* try 1 */"),
60
$executor->execute($testcase->queries()->[1]."/* try 2 */")
64
print Dumper \@results;
66
my $compare_outcome = GenTest::Comparator::compare(@results);
68
$dbh->do("DROP DATABASE sporadic$$");
70
if ($compare_outcome == STATUS_OK) {
71
open (LR, '>/tmp/last_not_repeatable.test');
72
print LR $testcase_string;
74
return ORACLE_ISSUE_NO_LONGER_REPEATABLE;
76
open (LR, '>/tmp/last_repeatable.test');
77
print LR $testcase_string;
79
return ORACLE_ISSUE_STILL_REPEATABLE;