From 86d5e29163da25548e87b166471ab148e5f830ba Mon Sep 17 00:00:00 2001 From: topunix <833824+topunix@users.noreply.github.com> Date: Thu, 30 Jul 2026 12:43:43 -0500 Subject: [PATCH 1/2] Bug 889650: Fix crash when searching "match all of the same field" on Flags --- Bugzilla/Search.pm | 2 +- xt/lib/Bugzilla/Test/Search/Constants.pm | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index d16ab46a02..365e307278 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 749b376964..0191d85427 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; From 40c6f0e76fedf9ab3ac8e1156cf6932c4e39b84c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 3 Aug 2026 17:43:52 +0100 Subject: [PATCH 2/2] Bug 889650: Fix tab character introduced in Search.pm indentation The fix for the Flags "match all of the same field" crash replaced a tab-indented line with a literal tab character instead of spaces, tripping t/005whitespace.t. --- Bugzilla/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 365e307278..dd32541269 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 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