1
# Copyright (C) 2009 Sun Microsystems, Inc. All rights reserved.
2
# Use is subject to license terms.
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; version 2 of the License.
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
# General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18
package GenTest::Executor::Dummy;
22
@ISA = qw(GenTest::Executor);
27
use GenTest::Constants;
29
use GenTest::Executor;
30
use GenTest::Translator;
31
use GenTest::Translator::MysqlDML2ANSI;
32
use GenTest::Translator::Mysqldump2ANSI;
33
use GenTest::Translator::MysqlDML2javadb;
34
use GenTest::Translator::Mysqldump2javadb;
35
use GenTest::Translator::MysqlDML2pgsql;
36
use GenTest::Translator::Mysqldump2pgsql;
45
## Just to have somthing that is not undefined
46
$executor->setDbh($executor);
48
$executor->defaultSchema("schema");
54
my ($self, $query, $silent) = @_;
56
$query = $self->preprocess($query);
58
## This may be generalized into a translator which is a pipe
61
if ($self->dsn() =~ m/javadb/) {
62
@pipe = (GenTest::Translator::Mysqldump2javadb->new(),
63
GenTest::Translator::MysqlDML2javadb->new());
65
} elsif ($self->dsn() =~ m/postgres/) {
67
@pipe = (GenTest::Translator::Mysqldump2pgsql->new(),
68
GenTest::Translator::MysqlDML2pgsql->new());
71
foreach my $p (@pipe) {
72
$query = $p->translate($query);
73
return GenTest::Result->new(
75
status => STATUS_WONT_HANDLE )
80
if ($ENV{RQG_DEBUG} or $self->dsn() =~ m/print/) {
81
print "Executing $query\n";
84
return new GenTest::Result(query => $query,
91
return "Version N/A"; # Not implemented in DBD::JDBC
95
my ($self,$schema) = @_;
96
return $self->defaultSchema();
99
sub getSchemaMetaData {
100
return [['schema','tab','table','col1','ordinary'],
101
['schema','tab','table','col2','primary'],
102
['schema','tab','table','col3','indexed']];
106
sub getCollationMetaData {
107
return [['collation','charset']];
112
$self->setDbh(undef);