diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index d16ab46a0..365e30727 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -3219,7 +3219,7 @@ sub _flagtypes_nonchanged { # don't call build_subselect as this must run as a true sub-select $args->{term} = "EXISTS ( SELECT 1 - FROM $bugs_table bugs_$chart_id + FROM bugs bugs_$chart_id LEFT JOIN attachments AS attachments_$chart_id ON bugs_$chart_id.bug_id = attachments_$chart_id.bug_id LEFT JOIN flags AS flags_$chart_id diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm index 749b37696..0191d8542 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -1257,6 +1257,15 @@ use constant CUSTOM_SEARCH_TESTS => ( ] }, + { + name => 'flagtypes.name = <1> AND flagtypes.name = <1>', + contains => [1], + top_params => {j_top => 'AND_G'}, + params => [ + {f => 'flagtypes.name', o => 'equals', v => '<1>'}, + {f => 'flagtypes.name', o => 'equals', v => '<1>'}, + ] + }, ); 1;