X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FOracle.pm;h=1a8d8171443cc7d25ada36f29ca87bde4eba8e30;hb=31a65b45d0092a32bcc45091382e9907afceb3f6;hp=e5e96f641745d2d0de92f60680b1a3bdb523d1ba;hpb=8803e4edc1fc42207406452ed9243413d49d695d;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm index e5e96f6..1a8d817 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm @@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.04999_09'; +our $VERSION = '0.05000'; =head1 NAME @@ -36,18 +36,20 @@ sub _setup { $self->next::method(@_); my $dbh = $self->schema->storage->dbh; - $self->{db_schema} ||= $dbh->selectrow_array('SELECT USER FROM DUAL', {}); -} + my ($current_schema) = $dbh->selectrow_array('SELECT USER FROM DUAL', {}); -sub _table_columns { - my ($self, $table) = @_; + $self->{db_schema} ||= $current_schema; - my $dbh = $self->schema->storage->dbh; + if (lc($self->db_schema) ne lc($current_schema)) { + $dbh->do('ALTER SESSION SET current_schema=' . $self->db_schema); + } +} + +sub _table_as_sql { + my ($self, $table) = @_; - my $sth = $dbh->prepare($self->schema->storage->sql_maker->select($table, undef, \'1 = 0')); - $sth->execute; - return \@{$sth->{NAME_lc}}; + return $self->_quote_table_name($table); } sub _tables_list { @@ -68,7 +70,7 @@ sub _tables_list { push @tables, $1 if $table =~ /\A(\w+)\z/; } - return @tables; + return $self->_filter_tables(@tables); } sub _table_uniq_info { @@ -153,9 +155,12 @@ L =head1 AUTHOR -TSUNODA Kazuya C +See L and L. + +=head1 LICENSE -Dagfinn Ilmari Mannsåker C +This library is free software; you can redistribute it and/or modify it under +the same terms as Perl itself. =cut