summaryrefslogtreecommitdiffstats
path: root/globals.pl
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 /globals.pl
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 'globals.pl')
-rw-r--r--globals.pl15
1 files changed, 8 insertions, 7 deletions
diff --git a/globals.pl b/globals.pl
index b0a8feca8..6e0ebd774 100644
--- a/globals.pl
+++ b/globals.pl
@@ -924,15 +924,16 @@ sub GetLongDescriptionAsText {
"WHERE profiles.userid = longdescs.who " .
"AND longdescs.bug_id = $id ");
- if ($start && $start =~ /[1-9]/) {
- # If $start is not all zeros, obtain the count-index
+ # $start will be undef for New bugs, and defined for pre-existing bugs.
+ if ($start) {
+ # If $start is not NULL, obtain the count-index
# of this comment for the leading "Comment #xxx" line.)
- $query .= "AND longdescs.bug_when > '$start'";
- SendSQL("SELECT count(*) FROM longdescs WHERE bug_id = $id AND bug_when <= '$start'");
+ SendSQL("SELECT count(*) FROM longdescs " .
+ " WHERE bug_id = $id AND bug_when <= '$start'");
($count) = (FetchSQLData());
- }
- if ($end) {
- $query .= "AND longdescs.bug_when <= '$end'";
+
+ $query .= " AND longdescs.bug_when > '$start'"
+ . " AND longdescs.bug_when <= '$end' ";
}
$query .= "ORDER BY longdescs.bug_when";