From d859529265b30a92ed7b60701d70fad5dcf60d2d Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Mon, 3 Aug 2026 20:04:30 -0400 Subject: [PATCH] Bug 889650: Fix crash when searching "match all of the same field" on Flags (#237) r=mrenvoize --- Bugzilla/Search.pm | 2 +- xt/lib/Bugzilla/Test/Search/Constants.pm | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 53ece5113b..8cddf76bbd 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -2900,7 +2900,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 fe5b0a7b72..7760ba432d 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -1244,6 +1244,16 @@ 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; -- 2.47.3