From 4910b3f9485a928091d98e5da83b16cebae33eed Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sat, 12 Mar 2005 03:45:01 +0000 Subject: Bug 285692: lastdiffed should use NULL instead of the "beginning of time" Patch By Max Kanat-Alexander r=glob, a=myk --- Bugzilla/BugMail.pm | 15 ++++++--------- Bugzilla/DB/Schema.pm | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 1221dcfbc..ba7c641df 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -172,9 +172,6 @@ sub ProcessOneBug($) { $values{component} = get_component_name($values{component_id}); my ($start, $end) = (@row); - # $start and $end are considered safe because users can't touch them - trick_taint($start); - trick_taint($end); my $cc_ref = Bugzilla->dbh->selectcol_arrayref( q{SELECT profiles.login_name FROM cc, profiles @@ -220,15 +217,16 @@ sub ProcessOneBug($) { my @diffs; - + # If lastdiffed is NULL, then we don't limit the search on time. + my $when_restriction = $start ? + " AND bug_when > '$start' AND bug_when <= '$end'" : ''; SendSQL("SELECT profiles.login_name, fielddefs.description, " . " bug_when, removed, added, attach_id, fielddefs.name " . "FROM bugs_activity, fielddefs, profiles " . "WHERE bug_id = $id " . " AND fielddefs.fieldid = bugs_activity.fieldid " . " AND profiles.userid = who " . - " AND bug_when > '$start' " . - " AND bug_when <= '$end' " . + $when_restriction . "ORDER BY bug_when" ); @@ -280,8 +278,7 @@ sub ProcessOneBug($) { " AND fielddefs.fieldid = bugs_activity.fieldid" . " AND (fielddefs.name = 'bug_status' " . " OR fielddefs.name = 'resolution') " . - " AND bug_when > '$start' " . - " AND bug_when <= '$end' " . + $when_restriction . "ORDER BY bug_when, bug_id"); my $thisdiff = ""; @@ -829,7 +826,7 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) { } } - my $isnew = ($start !~ m/[1-9]/); + my $isnew = !$start; my %substs; diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index a879684ea..9a156a1b0 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -154,7 +154,7 @@ use constant ABSTRACT_SCHEMA => { # comes from the keywords table keywords => {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => "''"}, - lastdiffed => {TYPE => 'DATETIME', NOTNULL => 1}, + lastdiffed => {TYPE => 'DATETIME'}, everconfirmed => {TYPE => 'BOOLEAN', NOTNULL => 1}, reporter_accessible => {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'TRUE'}, -- cgit v1.2.3-24-g4f1b