[mythtv-commits] Ticket #2342: EIT Data update fials due to duplicate keys

MythTV mythtv at cvs.mythtv.org
Fri Sep 8 09:04:35 UTC 2006

#2342: EIT Data update fials due to duplicate keys
 Reporter:  Karl    |       Owner:  ijr    
     Type:  defect  |      Status:  new    
 Priority:  minor   |   Milestone:  unknown
Component:  mythtv  |     Version:  head   
 Severity:  medium  |  
 Im seeing a lot of messages like this in my log file for the backend.....

 2006-09-07 13:39:09.063 DB Error (change_program):
 Query was:
 UPDATE program SET starttime = '2006-09-10T01:32:00',     endtime   =
 '2006-09-10T02:00:00' WHERE chanid    = 1717 AND       starttime = '2006-
 Driver error was [2/1062]:
 QMYSQL3: Unable to execute query
 Database error was:
 Duplicate entry '1717-2006-09-10 01:32:00-0' for key 1

 it appears that the database is ok - ran all the checks I could.

 I think the issue is that there is a program already in the program table
 for this time and channel, which will need deleting first else the primary
 key constraint is broken on the DB.

 Its an easy fix I think,

 1] lock the program table
 2] do a select for new starttime and channel, if fails - goto 4
 3] Delete this program
 4] Update record
 5] unlock table

 I have a preference for table locking as many people like myself use DVB
 but get 50% of the program guide from a grabber - so this could be running
 at the same time.

Ticket URL: <http://cvs.mythtv.org/trac/ticket/2342>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list