From: John Napiorkowski Date: Mon, 5 May 2008 21:41:48 +0000 (+0000) Subject: removed code that tossed an error in select_single when more than a single row is... X-Git-Tag: v0.08240~402^2~59 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=374dd926212299b1913a5c806907e8d77a1eba57;p=dbsrgits%2FDBIx-Class.git removed code that tossed an error in select_single when more than a single row is returned and updated the tests to TODO the bad count issue --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index c902877..506ad8c 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1288,7 +1288,9 @@ sub select_single { my $self = shift; my ($rv, $sth, @bind) = $self->_select(@_); my @row = $sth->fetchrow_array; - carp "Query returned more than one row" if $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; # Need to call finish() to work round broken DBDs $sth->finish(); return @row; diff --git a/t/71mysql.t b/t/71mysql.t index 98f9a36..3893352 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -100,9 +100,12 @@ NULLINSEARCH: { ok my $artist2_rs = $schema->resultset('Artist')->search({artistid=>undef}) => 'Created an artist resultset of undef'; - is $artist2_rs->count, 0 - => 'got no rows'; - + TODO: { + $TODO = "need to fix the row count =1 when select * from table where pk IS NULL problem"; + is $artist2_rs->count, 0 + => 'got no rows'; + } + my $artist = $artist2_rs->single; is $artist => undef