X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase%2FNoBindVars.pm;h=7737d95c85daff36e183414b03f06ed9a31bf5d1;hb=322b7a6b;hp=d40d0a638c12ec7d0948577550fe8ed0e80da83b;hpb=51ac7136944f82aa2675cc133a8d080c5fb367b1;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm index d40d0a6..7737d95 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm @@ -1,23 +1,26 @@ package DBIx::Class::Storage::DBI::Sybase::NoBindVars; -use Class::C3; use base qw/ DBIx::Class::Storage::DBI::NoBindVars DBIx::Class::Storage::DBI::Sybase /; +use mro 'c3'; use List::Util (); use Scalar::Util (); +sub new { + my $self = shift->next::method(@_); + $self->_rebless; + return $self; +} + sub _rebless { my $self = shift; $self->disable_sth_caching(1); - $self->unsafe_insert(1); # there is nothing unsafe as the - # last_insert_id mechanism is different - # without bindvars + $self->_identity_method('@@IDENTITY'); } -# this works when NOT using placeholders -sub _fetch_identity_sql { 'SELECT @@IDENTITY' } +sub _fetch_identity_sql { 'SELECT ' . $_[0]->_identity_method } my $number = sub { Scalar::Util::looks_like_number($_[0]) };