summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-09-28 07:18:08 +0200
committerlpsolit%gmail.com <>2005-09-28 07:18:08 +0200
commitb66dedd512a994882f51496a7436cf3bc028a8d6 (patch)
treecc5cb53c7cae3826beffe06468c202cfb6c03b98
parent40dcf522e094f7d9944524dbc1ebafc61b6642c8 (diff)
downloadbugzilla-b66dedd512a994882f51496a7436cf3bc028a8d6.tar.gz
bugzilla-b66dedd512a994882f51496a7436cf3bc028a8d6.tar.xz
Bug 309896: The "Saved searches" tab in User Prefs can report incorrect information - Patch by A. Karl Kornel <karl@kornel.name> r=LpSolit a=justdave
-rw-r--r--Bugzilla/User.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index f5aae89e1..fa924bf05 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -198,13 +198,19 @@ sub queries {
my $dbh = Bugzilla->dbh;
my $sth = $dbh->prepare(q{ SELECT
DISTINCT name, query, linkinfooter,
- CASE WHEN whine_queries.id
- IS NOT NULL THEN 1 ELSE 0 END,
+ CASE WHEN whine_queries.id IS NOT NULL
+ THEN 1 ELSE 0 END,
UPPER(name) AS uppername
FROM namedqueries
+ LEFT JOIN whine_events
+ ON whine_events.owner_userid =
+ namedqueries.userid
LEFT JOIN whine_queries
- ON whine_queries.query_name = name
- WHERE userid=?
+ ON whine_queries.query_name =
+ namedqueries.name
+ AND whine_queries.eventid =
+ whine_events.id
+ WHERE namedqueries.userid=?
ORDER BY uppername});
$sth->execute($self->{id});