Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13011 closed Patch - Feature (fixed)

Feature patch: Validate the XMLTV programme starttime/channel early in mythfilldatabase

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: stuartm
Priority: minor Milestone: unknown
Component: MythTV - Mythfilldatabase Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Validate the XMLTV programme starttime/channel early in mythfilldatabase

If a xmltv programme entry contains an invalid (or missing) start time, the resulting program object will have not have a starttime, which can result in attempts to insert into the program table and receiving constraint errors of the form:

2017-03-01 11:22:19.996778 E [14104/14104] CoreContext mythdb.cpp:183 (DBError) - DB Error (program insert):
Query was:
REPLACE INTO program (  chanid, title, subtitle, description, category, category_type, starttime, endtime, closecaptioned, stereo, hdtv, subtitled, subtitletypes, audioprop, videoprop, partnumber, parttotal, syndicatedepisodenumber, airdate, originalairdate, listingsource, seriesid, programid, previouslyshown, stars, showtype, title_pronounce, colorcode, season, episode, totalepisodes, inetref ) VALUES( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
Bindings were:
:AIRDATE="2017", :AUDIOPROP=0, :CATEGORY="Shopping", :CATTYPE="tvshow", :CC=false, :CHANID=30027, :COLORCODE="", :DESCRIPTION="Paid programming.", :ENDTIME="0000-00-00 00:00:00", :EPISODE=0, :HASSUBTITLES=false, :HDTV=true, :INETREF="", :LSOURCE=4, :ORIGAIRDATE=NULL, :PARTNUMBER=0, :PARTTOTAL=0, :PREVSHOWN=true, :PROGRAMID="SH000000010000", :SEASON=0, :SERIESID="EP00000001", :SHOWTYPE="", :STARS=0, :STARTTIME=NULL, :STEREO=false, :SUBTITLE="", :SUBTYPES=0, :SYNDICATENO="", :TITLE="Paid Programming", :TITLEPRON="", :TOTALEPISODES=0, :VIDEOPROP=1
Driver error was [2/1048]:
QMYSQL3: Unable to execute statement
Database error was:
Column 'starttime' cannot be null

If the programme entry does not have a channel there will be messages later about channel mismatching.

The xmltv dtd requires that start and channel are provided in the programme element.

This patch adds in validation to verify we obtain a valid xmltv start and channel. Handling this early allows (slightly) better informational messages and avoids the constraint db error.

github ref: https://github.com/garybuhrmaster/mythtv/commit/1f7848422fff5153132fa77967643d1848d3280e github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/1f7848422fff5153132fa77967643d1848d3280e.patch

Change History (2)

comment:1 Changed 3 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Resolution: fixed
Status: newclosed

In ab4513fbb6f50f1402835b5599f6ff79b4b0fd48/mythtv:

Validate the programme starttime/channel early

If a programme does not have a starttime the (later) attempted
insertion of the program into the database will result in a
database constraint error. If the program does not have a
channel there will be a match error later. Verify both early
(perhaps with better log messages).

Fixes #13011

Signed-off-by: Peter Bennett <pbennett@…>

comment:2 Changed 3 years ago by Gary Buhrmaster <gary.buhrmaster@…>

In 8f13742e18f76ede87e46f1ce12bd00aa40d621b/mythtv:

Validate the programme starttime/channel early

If a programme does not have a starttime the (later) attempted
insertion of the program into the database will result in a
database constraint error. If the program does not have a
channel there will be a match error later. Verify both early
(perhaps with better log messages).

Fixes #13011

Signed-off-by: Peter Bennett <pbennett@…>
(cherry picked from commit ab4513fbb6f50f1402835b5599f6ff79b4b0fd48)

Note: See TracTickets for help on using tickets.