X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase%2FASE.pm;h=eceef2016cc4c4e12b97d307ff963402e30238b0;hb=5529838f7afff91467ef2664087999ab222da48d;hp=3915eb2e2b13520743299ed1cf78609a44c6102c;hpb=47d7b769c034e04989840b1efc2f5991518cff23;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index 3915eb2..eceef20 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -16,6 +16,7 @@ use Sub::Name(); use Data::Dumper::Concise 'Dumper'; use Try::Tiny; use Context::Preserve 'preserve_context'; +use DBIx::Class::_Util 'sigwarn_silencer'; use namespace::clean; __PACKAGE__->sql_limit_dialect ('GenericSubQ'); @@ -178,11 +179,10 @@ sub disconnect { # Even though we call $sth->finish for uses off the bulk API, there's still an # "active statement" warning on disconnect, which we throw away here. -# This is due to the bug described in insert_bulk. +# This is due to the bug described in _insert_bulk. # Currently a noop because 'prepare' is used instead of 'prepare_cached'. - local $SIG{__WARN__} = sub { - warn $_[0] unless $_[0] =~ /active statement/i; - } if $self->_is_bulk_storage; + local $SIG{__WARN__} = sigwarn_silencer(qr/active statement/i) + if $self->_is_bulk_storage; # so that next transaction gets a dbh $self->_began_bulk_work(0) if $self->_is_bulk_storage; @@ -233,7 +233,7 @@ Also sets the C value for blob write operations. The default is C<1>, but C<0> is better if your database is configured for it. See -L. +L. =cut @@ -501,7 +501,7 @@ sub update { } } -sub insert_bulk { +sub _insert_bulk { my $self = shift; my ($source, $cols, $data) = @_; @@ -607,7 +607,7 @@ sub insert_bulk { # This ignores any data conversion errors detected by the client side libs, as # they are usually harmless. my $orig_cslib_cb = DBD::Sybase::set_cslib_cb( - Sub::Name::subname insert_bulk => sub { + Sub::Name::subname _insert_bulk_cslib_errhandler => sub { my ($layer, $origin, $severity, $errno, $errmsg, $osmsg, $blkmsg) = @_; return 1 if $errno == 36; @@ -685,7 +685,7 @@ sub insert_bulk { $self->_bulk_storage(undef); unshift @_, $self; - goto \&insert_bulk; + goto \&_insert_bulk; } elsif ($exception) { # rollback makes the bulkLogin connection unusable @@ -717,7 +717,7 @@ sub _remove_blob_cols { return %blob_cols ? \%blob_cols : undef; } -# same for insert_bulk +# same for _insert_bulk sub _remove_blob_cols_array { my ($self, $source, $cols, $data) = @_; @@ -748,7 +748,7 @@ sub _update_blobs { my ($self, $source, $blob_cols, $where) = @_; my @primary_cols = try - { $source->_pri_cols } + { $source->_pri_cols_or_die } catch { $self->throw_exception("Cannot update TEXT/IMAGE column(s): $_") }; @@ -783,7 +783,7 @@ sub _insert_blobs { my %row = %$row; my @primary_cols = try - { $source->_pri_cols } + { $source->_pri_cols_or_die } catch { $self->throw_exception("Cannot update TEXT/IMAGE column(s): $_") }; @@ -1082,15 +1082,15 @@ for L. =head1 LIMITED QUERIES -Because ASE does not have a good way to limit results in SQL that works for all -types of queries, the limit dialect is set to -L. +Because ASE does not have a good way to limit results in SQL that works for +all types of queries, the limit dialect is set to +L. Fortunately, ASE and L support cursors properly, so when -L is too slow you can use -the L -L attribute to simulate limited queries by skipping over -records. +L is too slow +you can use the L +L attribute to simulate limited queries by skipping +over records. =head1 TEXT/IMAGE COLUMNS