From: Rafael Kitover Date: Sat, 5 Sep 2009 05:23:57 +0000 (+0000) Subject: pending review by mpeppler X-Git-Tag: v0.08112~14^2~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9d9c67046115c4717b9ad49532b66d82d135310;p=dbsrgits%2FDBIx-Class.git pending review by mpeppler --- diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 43bb7bb..6c07369 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -12,7 +12,7 @@ use Carp::Clan qw/^DBIx::Class/; use List::Util (); __PACKAGE__->mk_group_accessors('simple' => - qw/_identity _blob_log_on_update unsafe_insert/ + qw/_identity _blob_log_on_update unsafe_insert _insert_dbh/ ); =head1 NAME @@ -129,6 +129,8 @@ sub _populate_dbh { $self->_dbh->do('SET CHAINED ON'); } } + + $self->_insert_dbh($self->_connect(@{ $self->_dbi_connect_info })); } =head2 connect_call_blob_setup @@ -258,7 +260,7 @@ sub _native_data_type { my ($self, $type) = @_; $type = lc $type; - $type =~ s/ identity//; + $type =~ s/\s* identity//x; return uc($TYPE_MAPPING{$type} || $type); } @@ -312,6 +314,7 @@ sub insert { if ( $need_last_insert_id && !$self->unsafe_insert && !$self->{transaction_depth} ) { + local $self->{_dbh} = $self->_insert_dbh; my $guard = $self->txn_scope_guard; my $upd_cols = $self->next::method (@_); $guard->commit; diff --git a/t/746sybase.t b/t/746sybase.t index a3b4d6f..7e5696a 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -307,9 +307,9 @@ CREATE TABLE money_test ( SQL }); -# test insert transactions when there's an active cursor +# test insert transaction when there's an active cursor TODO: { - local $TODO = 'not supported yet or possibly ever'; +# local $TODO = 'not supported yet or possibly ever'; SKIP: { skip 'not testing insert with active cursor if using unsafe_insert', 1