X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=b3ef3d6885237f924c69ff3f7367b634f26febd8;hb=f7ffc0af5950caccc0f25cb47ab23514fd66af7a;hp=506ad8c9eb1232077b50724523fdd648ce1e3b20;hpb=374dd926212299b1913a5c806907e8d77a1eba57;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 506ad8c..b3ef3d6 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1288,9 +1288,9 @@ sub select_single { my $self = shift; my ($rv, $sth, @bind) = $self->_select(@_); my @row = $sth->fetchrow_array; - ## TODO, we need to decide if we should throw an error when select_single - ## returns more than one row - #carp "Query returned more than one row" if $sth->fetchrow_array; + if(@row && $sth->fetchrow_array) { + carp "Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single"; + } # Need to call finish() to work round broken DBDs $sth->finish(); return @row;