Modify

Ticket #3681 (closed defect: fixed)

You must read the TicketHowTo before creating a new ticket or commenting on an existing ticket.

Opened 5 years ago

Last modified 4 years ago

mythfilldatabase erroneously deletes record schedules for the current day

Reported by: Tom Dexter <digitalaudiorock@…> Owned by: stuartm
Priority: major Milestone: 0.21
Component: mythfilldatabase Version: unknown
Severity: medium Keywords: mythfilldatabase schedules
Cc: Ticket locked: no

Description

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 programs/mythfilldatabase/filldata.cpp (in 0.20) and libs/libmythtv/programdata.cpp (in 0.21):

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.

Attachments

3681_patch.patch Download (600 bytes) - added by Jeff <jeff@…> 5 years ago.
a patch

Change History

comment:1 Changed 5 years ago by Jeff <jeff@…>

This also drives me insane.

comment:2 follow-up: ↓ 3 Changed 5 years ago by anonymous

We don't need "Me too" posts.

Changed 5 years ago by Jeff <jeff@…>

a patch

comment:3 in reply to: ↑ 2 Changed 5 years ago by Jeff <jeff@…>

Replying to anonymous:

We don't need "Me too" posts.

Sorry.

comment:4 Changed 5 years ago by Tom Dexter <digitalaudiorock@…>

Just curious...is this also going to get patched in the release-0-20-fixes branch (in programs/mythfilldatabase/filldata.cpp)?

Thanks.

comment:5 Changed 5 years ago by stuartm

  • Status changed from new to closed
  • Resolution set to fixed

(In [13793]) Fixes #3681

Use CURDATE() instead of NOW() to prevent ProgramData::clearOldDBEntries deleting certain recording rules early.

comment:6 Changed 5 years ago by stuartm

(In [13794]) Backport [13793] to -fixes.

Fix certain recording rule types being deleted early by mythfilldatabase.

Refs #3681

comment:7 Changed 4 years ago by stuartm

  • Milestone changed from unknown to 0.21
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.