1
package GenTest::Validator::Falcon;
4
@ISA = qw(GenTest::Validator GenTest);
10
use GenTest::Constants;
12
use GenTest::Validator;
17
my ($validator, $executors) = @_;
20
# We could use the DBI connection already established by the Executor, however this will mean that
21
# the Validator SELECT statements will be interleaved with the other statements issued by the Executor.
22
# If we have transactions, SELECT-ing over entire tables will certainly change the behavoir of the transaction
25
my $dsn = $executors->[0]->dsn();
26
my $dbh = DBI->connect($dsn, undef, undef, { RaiseError => 1 });
27
$validator->setDbh($dbh);
29
$dbh->do("SET AUTOCOMMIT=ON");
37
my ($validator, $executors) = @_;
39
my $dbh = $validator->dbh();
40
my $executor = $executors->[0];
42
my $tables = $executor->tables();
43
foreach my $table (@$tables) {
44
my $sth = $dbh->prepare("
45
SELECT pk, COUNT(*) AS C
51
my $rows = $sth->rows();
56
say("Table $table contains duplicate primary keys.");
57
return STATUS_DATABASE_CORRUPTION;