Opened 10 years ago

Closed 7 years ago

#12134 closed Bug Report - General (Duplicate)

Programrating update/insertdb insert ignore instead of insert

Reported by: slackerlinux85@… Owned by: stuartm
Priority: minor Milestone: 0.28.2
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

currently a sql statement in programdata.cpp is spamming the backend logs with this

2014-04-07 21:57:54.991046 E [1013/1329] EIT mythdb.cpp:183 (DBError) - DB Error (programrating insert):
Query was:
INSERT INTO programrating        ( chanid, starttime, system, rating) VALUES (?, ?,    ?,  ?)
Bindings were:
:CHANID=1007, :RATING="G", :START=2014-04-12T07:30:00Z, :SYS=""
Driver error was [2/1062]:
QMYSQL3: Unable to execute statement
Database error was:
Duplicate entry '1007-2014-04-12 07:30:00--G' for key 'chanid'

attached patch switches the sql statement to insert ignore so it doesnt spam the logs. behaviour shouldnt change since it wasnt adding/updating the fields on error anyway

Attachments (1)

programrating-insertignore.patch (984 bytes) - added by slackerlinux85@… 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by slackerlinux85@…

comment:1 Changed 10 years ago by stuartm

Milestone: unknown0.28
Owner: set to stuartm
Status: newaccepted
Version: UnspecifiedMaster Head

comment:2 Changed 8 years ago by Stuart Auchterlonie

Milestone: 0.280.28.1

Moving unresolved tickets to next point release

comment:3 Changed 7 years ago by Stuart Auchterlonie

Milestone: 0.28.10.28.2

Moving remaining open 0.28.1 tickets to 0.28.2

comment:4 Changed 7 years ago by benjamin.close@…

I suspect instead of using the ignore, the insert into, should become a REPLACE INTO incase the rating data has actually changed.

comment:5 in reply to:  4 Changed 7 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Replying to benjamin.close@…:

I suspect instead of using the ignore, the insert into, should become a REPLACE INTO incase the rating data has actually changed.

Actually, given that the key is the entire sequence (chanid, starttime, system, and rating), which preserves different ratings, the problem only exists for duplicated source data (which is usually bad source data).

In any case, I believe this ticket should likely be closed as a dup by someone appropriately empowered to close tickets, as it appears to have been fixed in #12914 which also contained some background discussion (and embarrassingly did not identify this ticket as being related/original).

comment:6 Changed 7 years ago by Peter Bennett

Resolution: Duplicate
Status: acceptedclosed

Duplicate of #12914.

Note: See TracTickets for help on using tickets.