Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 183268 - mythfilldatabase erroneously deletes record schedules for the current day
Summary: mythfilldatabase erroneously deletes record schedules for the current day
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords:
: 187445 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-26 14:10 UTC by Tom Dexter
Modified: 2007-08-06 21:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Dexter 2007-06-26 14:10:43 UTC
mythfilldata always deletes records from the record table with types of single, override, or dontrecord whose enddate is the current day.

The problem is in the clearOldDBEntries in the file filldata.cpp:

query.prepare("DELETE FROM record WHERE (type = :SINGLE "
                  "OR type = :OVERRIDE OR type = :DONTRECORD) "
                  "AND enddate < NOW();");
    query.bindValue(":SINGLE", kSingleRecord);
    query.bindValue(":OVERRIDE", kOverrideRecord);
    query.bindValue(":DONTRECORD", kDontRecord);
    query.exec();

Since enddate is a date column (not datetime) it's getting compared to NOW() as a datetime at 12:00AM, thus always less than NOW().  Using either CURDATE(), CURRENT_DATE, or CAST(NOW() AS DATE) in place of NOW() would work correctly.


Reproducible: Always

Steps to Reproduce:
1. Schedule a "record only this showing" type for the current day.
2. Run mythfilldatabase.


Actual Results:  
The schedule gets deleted.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-06-26 14:14:36 UTC
Always provide ebuild name and version in bug summary, please.
Comment 2 Tom Dexter 2007-06-26 14:30:20 UTC
Sorry...I forgot to include that this is occuring in:

media-tv/mythtv-0.20.1_p13344
dev-db/mysql-5.0.42

...though it appears to be the same in media-tv/mythtv-0.20_p12325.
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2007-06-28 18:23:35 UTC
Have you filed this upstream?
Comment 4 Tom Dexter 2007-06-29 16:24:09 UTC
At the time I entered this, I thought it might be something that had already been resolved upstream.  As far as I can see I don't think it has been, so I will file a bug today.
Comment 5 Tom Dexter 2007-06-29 17:14:52 UTC
I filed this mythtv bug:

http://svn.mythtv.org/trac/ticket/3681

I found that this doesn't appear to have been corrected in 0.21 either, though the code is now in /libs/libmythtv/programdata.cpp rather than /programs/mythfilldatabase/filldata.cpp.
Comment 6 Tom Dexter 2007-07-02 17:26:59 UTC
It appears that this has been resolved upstream for both 0.20 and 0.21.
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2007-07-02 17:50:26 UTC
This will be fixed in a mythtv ebuild newer then 13794. So >=media-tv/mythtv-0.21_p13794
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2007-08-06 21:42:01 UTC
Fixed in mythtv-0.20.1_p14146
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2007-08-06 21:43:28 UTC
*** Bug 187445 has been marked as a duplicate of this bug. ***