[Bast-commits] r8002 - in
branches/DBIx-Class-Schema-Loader/current: .
lib/DBIx/Class/Schema/Loader/DBI
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Dec 1 01:43:04 GMT 2009
Author: caelum
Date: 2009-12-01 01:43:04 +0000 (Tue, 01 Dec 2009)
New Revision: 8002
Modified:
branches/DBIx-Class-Schema-Loader/current/Changes
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
Log:
better handling of db_schema for Oracle, based on (RT#35732)
Modified: branches/DBIx-Class-Schema-Loader/current/Changes
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/Changes 2009-11-30 23:50:30 UTC (rev 8001)
+++ branches/DBIx-Class-Schema-Loader/current/Changes 2009-12-01 01:43:04 UTC (rev 8002)
@@ -1,5 +1,7 @@
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)
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm 2009-11-30 23:50:30 UTC (rev 8001)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm 2009-12-01 01:43:04 UTC (rev 8002)
@@ -36,7 +36,14 @@
$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);
+ }
}
More information about the Bast-commits
mailing list