From 57f73b8a4c34ea2c0ba8a05813b01479714f6789 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] 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;