my %args = @_;
my $db_schema = uc $class->_loader_data->{db_schema};
my $dbh = $class->storage->dbh;
+ my $quoter = $dbh->get_info(29) || q{"};
# this is split out to avoid version parsing errors...
my $is_dbd_db2_gte_114 = ( $DBD::DB2::VERSION >= 1.14 );
: $dbh->tables;
# People who use table or schema names that aren't identifiers deserve
# what they get. Still, FIXME?
- s/\"//g for @tables;
+ s/$quoter//g for @tables;
@tables = grep {!/^SYSIBM\./ and !/^SYSCAT\./ and !/^SYSSTAT\./} @tables;
@tables = grep {/^$db_schema\./} @tables if($db_schema);
return @tables;
sub _loader_tables {
my $class = shift;
my $dbh = $class->storage->dbh;
+ my $quoter = $dbh->get_info(29) || q{"};
# This is split out to avoid version parsing errors...
my $is_dbd_pg_gte_131 = ( $DBD::Pg::VERSION >= 1.31 );
- my @tables = $is_dbd_pg_gte_131 ?
- $dbh->tables( undef, $class->_loader_data->{db_schema}, "", "table", { noprefix => 1, pg_noprefix => 1 } )
+ my @tables = $is_dbd_pg_gte_131
+ ? $dbh->tables( undef, $class->_loader_data->{db_schema}, "",
+ "table", { noprefix => 1, pg_noprefix => 1 } )
: $dbh->tables;
- s/"//g for @tables;
+ s/$quoter//g for @tables;
return @tables;
}
sub _loader_table_info {
my ( $class, $table ) = @_;
my $dbh = $class->storage->dbh;
+ my $quoter = $dbh->get_info(29) || q{"};
my $sth = $dbh->column_info(undef, $class->_loader_data->{db_schema}, $table, undef);
my @cols = map { $_->[3] } @{ $sth->fetchall_arrayref };
- s/"//g for @cols;
+ s/$quoter//g for @cols;
my @primary = $dbh->primary_key(undef, $class->_loader_data->{db_schema}, $table);
- s/"//g for @primary;
+ s/$quoter//g for @primary;
return ( \@cols, \@primary );
}
my $dbname = $conn{database} || $conn{dbname} || $conn{db};
die("Can't figure out the table name automatically.") if !$dbname;
- my $quoter = $dbh->get_info(29);
+ my $quoter = $dbh->get_info(29) || q{`};
foreach my $table (@tables) {
my $query = "SHOW CREATE TABLE ${dbname}.${table}";
my $class = shift;
my $dbh = $class->storage->dbh;
my @tables;
+ my $quoter = $dbh->get_info(29) || q{`};
foreach my $table ( $dbh->tables ) {
- my $quoter = $dbh->get_info(29);
- $table =~ s/$quoter//g if ($quoter);
+ $table =~ s/$quoter//g;
push @tables, $1
if $table =~ /\A(\w+)\z/;
}