summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-12 04:45:01 +0100
committermkanat%kerio.com <>2005-03-12 04:45:01 +0100
commit4910b3f9485a928091d98e5da83b16cebae33eed (patch)
tree86285755c4d1fdcd4b7fef7a4d2e0caacf11bc20 /Bugzilla
parentaf17bfb29507e2fd93aca4e6f602c527b0e05bd2 (diff)
downloadbugzilla-4910b3f9485a928091d98e5da83b16cebae33eed.tar.gz
bugzilla-4910b3f9485a928091d98e5da83b16cebae33eed.tar.xz
Bug 285692: lastdiffed should use NULL instead of the "beginning of time"
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=glob, a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/BugMail.pm15
-rw-r--r--Bugzilla/DB/Schema.pm2
2 files changed, 7 insertions, 10 deletions
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'},