From: Rafael Kitover Date: Wed, 5 Aug 2009 09:48:04 +0000 (+0000) Subject: update branch after pull X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb7f8fb74b10ef5f3ef254edfc07773979a5e0b4;p=dbsrgits%2FDBIx-Class-Historic.git update branch after pull --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 7a7bd60..3c34088 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -797,17 +797,18 @@ sub _determine_driver { my ($self) = @_; if (not $self->_driver_determined) { - if (ref($self) eq __PACKAGE__) { - my $driver; my $started_unconnected = 0; local $self->{_in_determine_driver} = 1; + if (ref($self) eq __PACKAGE__) { + my $driver; if ($self->_dbh) { # we are connected $driver = $self->_dbh->{Driver}{Name}; } else { # try to use dsn to not require being connected, the driver may still # force a connection in _rebless to determine version ($driver) = $self->_dbi_connect_info->[0] =~ /dbi:([^:]+):/i; + $started_unconnected = 1; } my $storage_class = "DBIx::Class::Storage::DBI::${driver}"; @@ -816,7 +817,6 @@ sub _determine_driver { bless $self, $storage_class; $self->_rebless(); } - $started_unconnected = 1; } $self->_driver_determined(1); diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index 9d88ed0..b0da553 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -30,14 +30,14 @@ sub insert_bulk { if ($identity_insert) { my $table = $source->from; - $self->dbh->do("SET IDENTITY_INSERT $table ON"); + $self->_get_dbh->do("SET IDENTITY_INSERT $table ON"); } $self->next::method(@_); if ($identity_insert) { my $table = $source->from; - $self->dbh->do("SET IDENTITY_INSERT $table OFF"); + $self->_get_dbh->do("SET IDENTITY_INSERT $table OFF"); } } @@ -68,7 +68,7 @@ sub insert { grep { not exists $to_insert->{$_} } (@pk_guids, @auto_guids); for my $guid_col (@get_guids_for) { - my ($new_guid) = $self->dbh->selectrow_array('SELECT NEWID()'); + my ($new_guid) = $self->_get_dbh->selectrow_array('SELECT NEWID()'); $updated_cols->{$guid_col} = $to_insert->{$guid_col} = $new_guid; } @@ -145,7 +145,7 @@ sub last_insert_id { shift->_identity } sub _svp_begin { my ($self, $name) = @_; - $self->dbh->do("SAVE TRANSACTION $name"); + $self->_get_dbh->do("SAVE TRANSACTION $name"); } # A new SAVE TRANSACTION with the same name releases the previous one. @@ -154,7 +154,7 @@ sub _svp_release { 1 } sub _svp_rollback { my ($self, $name) = @_; - $self->dbh->do("ROLLBACK TRANSACTION $name"); + $self->_get_dbh->do("ROLLBACK TRANSACTION $name"); } sub build_datetime_parser { diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm index 5a98813..757d4d9 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm @@ -29,7 +29,7 @@ sub _ping { sub _placeholders_supported { my $self = shift; - my $dbh = $self->_dbh; + my $dbh = $self->_get_dbh; return eval { # There's also $dbh->{syb_dynamic_supported} but it can be inaccurate for this diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm index 5e53118..6a20ba4 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm @@ -11,7 +11,7 @@ use mro 'c3'; sub _rebless { my $self = shift; - my $dbh = $self->_dbh; + my $dbh = $self->_get_dbh; if (not $self->_placeholders_supported) { bless $self,