From: Laurent Dami Date: Thu, 6 Nov 2008 03:10:46 +0000 (+0000) Subject: DBIx::Class directly calls _recurse_where in scalar context, so we must implement... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=311b2151b1bb7ecb9cb2ad52f9bc5cbe73f3578d;p=scpubgit%2FQ-Branch.git DBIx::Class directly calls _recurse_where in scalar context, so we must implement it, even if not in the official API --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 8fadec4..92d52ad 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -326,7 +326,13 @@ sub _recurse_where { # dispatch on appropriate method according to refkind of $where my $method = $self->_METHOD_FOR_refkind("_where", $where); - $self->$method($where, $logic); + + + my ($sql, @bind) = $self->$method($where, $logic); + + # DBIx::Class directly calls _recurse_where in scalar context, so + # we must implement it, even if not in the official API + return wantarray ? ($sql, @bind) : $sql; }