Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#41 closed defect (fixed)

innreport creates incorrect file names at the start of the year

Reported by: eagle Owned by: eagle
Priority: medium Milestone: 2.5.0
Component: utilities Version:
Severity: normal Keywords:
Cc:

Description

Reported by Julien ÉLIE <julien@…>:

There is a problem in the name of the last report of the year. Instead of being named « news-notice.2006.12.31-04.15.02.html », it is named « news-notice.2006.01.01-00.00.00.html » and thus breaks everything in the html page (it is put at the bottom...).

And the line is « Jan 1 00:00:00 -- Dec 31 23:59:59 » instead of « Dec 31 04:15:02 -- Jan 2 04:15:03 ».

Change History (4)

comment:1 Changed 11 years ago by Julien ÉLIE

Milestone: 2.6.0
Version: 2.4.5

Test case:

Dec 31 19:27:55 news innd: ME status seconds 147396 accepted 3217 refused 11238 rejected 12 duplicate 0 accepted size 3885778 duplicate size 0 rejected size 21506
Jan  9 19:27:58 news innd: news.matabio.net status seconds 23306 accepted 1 refused 1350 rejected 0 duplicate 0 accepted size 2018 duplicate size 0 rejected size 0

According to Alexander Bartolich:

It triggers three problems in the following code:

     if ($cvtdate < $first_date_cvt) {
       $first_date_cvt = $cvtdate;
       $first_date = "$day $hour";
     }
     elsif ($cvtdate > $last_date_cvt) {
       $last_date_cvt = $cvtdate;
       $last_date = "$day $hour";
     }
  1. There is no check for wrap-around in date values, i.e. the code assumes the log covers the range from January to December. Interestingly function DateCompare? (used for a different purpose) does make such a check.
  1. If log entries are sorted descending then $last_date is never assigned to.
  1. If the log consists of only one line then $last_date is never assigned to.

comment:2 Changed 11 years ago by Julien ÉLIE

(In [8287]) Fix a bug in innreport when the log consists of only one line;
then $last_date was never assigned to.

Patch from Alexander Bartolich.

see #41 (only the third problem)

comment:3 Changed 11 years ago by Julien ÉLIE

Resolution: fixed
Status: newclosed

(In [8292]) innreport created incorrect file names at the start of the year:
the change of year was not seen.
Instead of creating "Dec 31 04:15:02 -- Jan 2 04:15:03", it
generated a wrong "Jan 1 00:00:00 -- Dec 31 23:59:59".

Thanks to Alexander Bartolich for the patch!

close #41

comment:4 Changed 10 years ago by Julien ÉLIE

Milestone: 2.6.02.5.0
Note: See TracTickets for help on using tickets.