use Class::C3;
use Carp::Clan qw/^DBIx::Class/;
-our $VERSION = '0.04999_13';
+our $VERSION = '0.05002';
=head1 NAME
my $dbh = $self->schema->storage->dbh;
my @tables = $dbh->tables(undef, $self->db_schema, $table, $type);
- my $qt = qr/\Q$self->{_quoter}\E/;
+ my $qt = qr/[\Q$self->{_quoter}\E"'`\[\]]/;
- if ($self->{_quoter} && $tables[0] =~ /$qt/) {
+ my $all_tables_quoted = (grep /$qt/, @tables) == @tables;
+
+ if ($self->{_quoter} && $all_tables_quoted) {
s/.* $qt (?= .* $qt)//xg for @tables;
} else {
s/^.*\Q$self->{_namesep}\E// for @tables;
my @filtered_tables;
for my $table (@tables) {
- my $sth = $self->_sth_for($table, undef, \'1 = 0');
- eval { $sth->execute };
+ eval {
+ my $sth = $self->_sth_for($table, undef, \'1 = 0');
+ $sth->execute;
+ };
if (not $@) {
push @filtered_tables, $table;
}
else {
warn "Bad table or view '$table', ignoring: $@\n";
+ local $@;
+ eval {
+ my $schema = $self->schema;
+ # in older DBIC it's a private method
+ my $unregister = $schema->can('unregister_source')
+ || $schema->can('_unregister_source');
+ $schema->$unregister($self->_table2moniker($table));
+ };
}
}