X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsearch%2Fstack_cond.t;h=d43f274c95be5d60a7888573613deb047ba178c8;hb=135ac69ddafd158cbfa4082871599ee104bbd205;hp=a68f6922670f5d6a185c2425ebd0c23aa3491bfa;hpb=22485a7ea98d355acc7dc5432550d10dba0dee5e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/search/stack_cond.t b/t/search/stack_cond.t index a68f692..d43f274 100644 --- a/t/search/stack_cond.t +++ b/t/search/stack_cond.t @@ -35,8 +35,10 @@ for my $c ( my $bare_cond = is_literal_value($c->{cond}) ? { '=', $c->{cond} } : $c->{cond}; my @query_steps = ( - # this is a monkey-wrench, always there + # these are monkey-wrenches, always there { title => { '!=', [ -and => \'bar' ] }, year => { '!=', [ -and => 'bar' ] } }, + { -or => [ genreid => undef, genreid => { '!=' => \42 } ] }, + { -or => [ genreid => undef, genreid => { '!=' => \42 } ] }, { title => $bare_cond, year => { '=', $c->{cond} } }, { -and => [ year => $bare_cond, { title => { '=', $c->{cond} } } ] }, @@ -69,7 +71,18 @@ for my $c ( "( SELECT me.title FROM cd me - WHERE title != bar AND title $c->{sql} AND year != ? AND year $c->{sql} + WHERE + ( genreid != 42 OR genreid IS NULL ) + AND + ( genreid != 42 OR genreid IS NULL ) + AND + title != bar + AND + title $c->{sql} + AND + year != ? + AND + year $c->{sql} )", \@bind, 'Double condition correctly collapsed for steps' . Dumper \@query_steps,