From: Peter Rabbitson Date: Wed, 24 Mar 2010 13:30:16 +0000 (+0000) Subject: Cosmetics + changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=734868da8acee7ff14dff8b91ab18f0edc3c10df;p=dbsrgits%2FDBIx-Class-Historic.git Cosmetics + changes --- diff --git a/Changes b/Changes index 8ca8f3c..9b4f636 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for DBIx::Class - Support for Firebird RDBMS with DBD::InterBase and ODBC + - Add core support for INSERT RETURNING (for storages that + supports this syntax, currently PostgreSQL and Firebird) - DBIx::Class::InflateColumn::File entered deprecated state - DBIx::Class::Optional::Dependencies left experimental state - Add req_group_list to Opt::Deps (RT#55211) diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index ceb38d5..1174519 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -364,7 +364,7 @@ sub insert { $source, { $self->get_columns }, (keys %auto_pri) && $source->storage->can_insert_returning - ? { returning => [ sort { $auto_pri{$a} cmp $auto_pri{$b} } keys %auto_pri ] } + ? { returning => [ sort { $auto_pri{$a} <=> $auto_pri{$b} } keys %auto_pri ] } : () , ); diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 1b5e6d8..1444cfe 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -62,8 +62,7 @@ sub _sequence_fetch { $self->throw_exception('No sequence to fetch') unless $sequence; my ($val) = $self->_get_dbh->selectrow_array( - sprintf "select $function('%s')", - $sequence + sprintf ("select %s('%s')", $function, $sequence) ); return $val; diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index ec31bd3..c21fe8a 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -306,6 +306,7 @@ has 'write_handler' => ( backup is_datatype_numeric + can_insert_returning _count_select _subq_count_select _subq_update_delete