diff options
author | terry%mozilla.org <> | 2000-01-17 20:38:39 +0100 |
---|---|---|
committer | terry%mozilla.org <> | 2000-01-17 20:38:39 +0100 |
commit | 9178b8f1a5722ad7957b33ffb6f8b9ef40c8f394 (patch) | |
tree | a9b5cc11646f098d682e28ab25e1a8e6b8a7acc4 /process_bug.cgi | |
parent | 55a22efb11b4ae0df4d279a14f8b44785e4832fe (diff) | |
download | bugzilla-9178b8f1a5722ad7957b33ffb6f8b9ef40c8f394.tar.gz bugzilla-9178b8f1a5722ad7957b33ffb6f8b9ef40c8f394.tar.xz |
Added a "keywords" field to a bug, which is a cached string-based copy
of all the keywords assigned to the bug. Right now, we only have code
that generates and maintains this field; soon will come code that
actually uses it.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index a11b0a9a1..bc7e2fcbc 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -455,20 +455,6 @@ sub SnapShotDeps { } -sub SnapShotKeywords { - my ($id) = (@_); - SendSQL("SELECT keyworddefs.name - FROM keyworddefs, keywords - WHERE keywords.bug_id = $id AND keyworddefs.id = keywords.keywordid - ORDER BY keyworddefs.name"); - my @list; - while (MoreSQLData()) { - push(@list, FetchOneColumn()); - } - return join(',', @list); -} - - my $whoid = DBNameToIdAndCheck($::FORM{'who'}); my $timestamp; @@ -490,7 +476,6 @@ foreach my $id (@idlist) { my %dependencychanged; SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, dependencies write, votes write, keywords write, keyworddefs read"); my @oldvalues = SnapShotBug($id); - my $oldkeywords = SnapShotKeywords($id); if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) { print " @@ -587,18 +572,36 @@ The changes made were: # For add, we delete things we're adding (to make sure we don't # end up having them twice), and then we add them. # For delete, we just delete things on the list. + my $changed = 0; if ($keywordaction eq "makeexact") { SendSQL("DELETE FROM keywords WHERE bug_id = $id"); + $changed = 1; } foreach my $keyword (@keywordlist) { if ($keywordaction ne "makeexact") { SendSQL("DELETE FROM keywords WHERE bug_id = $id AND keywordid = $keyword"); + $changed = 1; } if ($keywordaction ne "delete") { SendSQL("INSERT INTO keywords (bug_id, keywordid) VALUES ($id, $keyword)"); + $changed = 1; + } + } + if ($changed) { + SendSQL("SELECT keyworddefs.name + FROM keyworddefs, keywords + WHERE keywords.bug_id = $id + AND keyworddefs.id = keywords.keywordid + ORDER BY keyworddefs.name"); + my @list; + while (MoreSQLData()) { + push(@list, FetchOneColumn()); } + SendSQL("UPDATE bugs SET keywords = " . + SqlQuote(join(', ', @list)) . + " WHERE bug_id = $id"); } } @@ -685,9 +688,7 @@ The changes made were: # my @newvalues = SnapShotBug($id); - push(@oldvalues, $oldkeywords); - push(@newvalues, SnapShotKeywords($id)); - foreach my $c (@::log_columns, "keywords") { + foreach my $c (@::log_columns) { my $col = $c; # We modify it, don't want to modify array # values in place. my $old = shift @oldvalues; |