From: Matt S Trout Date: Mon, 7 Oct 2013 10:03:10 +0000 (+0000) Subject: only generate a cond for update/delete if we actually have one X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fff4fe520c30a1b3dc13727aefcf9b16ed9ce3a1;p=dbsrgits%2FDBIx-Class.git only generate a cond for update/delete if we actually have one --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index f7dedfb..9f0ffdf 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1927,11 +1927,13 @@ sub _rs_update_delete { # Most databases do not allow aliasing of tables in UPDATE/DELETE. Thus # a condition containing 'me' or other table prefixes will not work # at all. Tell SQLMaker to dequalify idents via a gross hack. - $cond = do { - my $sqla = $rsrc->storage->sql_maker; - local $sqla->{_dequalify_idents} = 1; - \[ $sqla->_recurse_where($self->{cond}) ]; - }; + if ($self->{cond}) { + $cond = do { + my $sqla = $rsrc->storage->sql_maker; + local $sqla->{_dequalify_idents} = 1; + \[ $sqla->_recurse_where($self->{cond}) ]; + }; + } } else { # we got this far - means it is time to wrap a subquery