Revision history for Perl extension DBIx::Class::Schema::Loader
+ - better handling of db_schema for Oracle, based on (RT#35732)
+
0.04999_12 2009-11-30 23:36:14
- fix MySQL rel introspection with on_connect_call =>
'set_strict_mode' (RT#52087)
$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', {});
+
+ $self->{db_schema} ||= $current_schema;
+
+ if (lc($self->db_schema) ne lc($current_schema)) {
+ $dbh->do('ALTER SESSION SET current_schema=' . $self->db_schema);
+ }
}