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::FullScan;
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
$dbh->do("CREATE DATABASE IF NOT EXISTS fullscan; USE fullscan");
43
$dbh->do($testcase->mysqldOptionsToString());
44
$dbh->do($testcase->dbObjectsToString());
46
my $original_query = $testcase->queries()->[0];
48
my $original_result = $executor->execute($original_query);
50
my @table_names = @{$dbh->selectcol_arrayref("SHOW TABLES")};
51
foreach my $table_name (@table_names) {
52
$dbh->do("ALTER TABLE $table_name DISABLE KEYS");
55
$dbh->do("SET SESSION join_cache_level = 0");
56
$dbh->do("SET SESSION optimizer_use_mrr = 'disable'");
57
$dbh->do("SET SESSION optimizer_switch='index_condition_pushdown=off'");
59
my $fullscan_result = $executor->execute($original_query);
61
$dbh->do("DROP DATABASE fullscan");
63
my $compare_outcome = GenTest::Comparator::compare($original_result, $fullscan_result);
66
($original_result->status() != STATUS_OK) ||
67
($fullscan_result->status() != STATUS_OK) ||
68
($compare_outcome == STATUS_OK)
70
return ORACLE_ISSUE_NO_LONGER_REPEATABLE;
72
return ORACLE_ISSUE_STILL_REPEATABLE;