From: Daniel Westermann-Clark Date: Sat, 15 Jul 2006 18:20:53 +0000 (+0000) Subject: Disable _is_unique_query check in single() since it can't infer properly yet X-Git-Tag: v0.07002~75^2~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28d25740d3582a675fa993814da772d0fda0622b;p=dbsrgits%2FDBIx-Class.git Disable _is_unique_query check in single() since it can't infer properly yet --- diff --git a/Changes b/Changes index 1285abc..803a6af 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for DBIx::Class + - supress warnings for possibly non-unique queries, since + _is_unique_query doesn't infer properly in all cases - skip empty queries to eliminate spurious warnings on ->deploy - fixups to ORDER BY, tweaks to deepen some copies in ResultSet - fixup for RowNum limit syntax with functions diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index fd56b5f..7e94eab 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -464,10 +464,11 @@ sub single { } } - unless ($self->_is_unique_query($attrs->{where})) { - carp "Query not guaranteed to return a single row" - . "; please declare your unique constraints or use search instead"; - } +# XXX: Disabled since it doesn't infer uniqueness in all cases +# unless ($self->_is_unique_query($attrs->{where})) { +# carp "Query not guaranteed to return a single row" +# . "; please declare your unique constraints or use search instead"; +# } my @data = $self->result_source->storage->select_single( $attrs->{from}, $attrs->{select},