[mythtv] Missed recordings caused by EIT guide update

Philipp Hahn pmhahn+mythtv at pmhahn.de
Thu Sep 12 05:17:24 UTC 2019


Hi,

Am 02.09.19 um 21:11 schrieb Klaas de Waal:
> About the root cause
> I would like to point out again that this bug is made possible by what
> is to me a design flaw.
> An entry in table program is identified by the chanid plus the starttime.
> The starttime is part of the the data of the program (program as in TV
> program....)
> so if the starttime changes that entry in table program cannot be found anymore.
> The solution for this, as implemented in the EIT update code in programdata.cpp,
> is to modify the starttime everywhere there is a reference (chanid
> plus starttime)
> to an entry in table program  when the starttime in that entry is changed.
> This is done for a number of tables but not for table record.
> The patch I wrote does this also for table record.
> A better solution would be to add a unique key to table program and use that
> in all references but that is rather more work and even worse, does
> require a database schema change.

Both MySQL and PostgreSQL support "ON UPDATE CASCADE", but the Schema
definition all lack the required "REFERENCES $table($column)" statements
for that to work. Then the DBMS would do the job for you, faster and
less error prone and guaranteed to follow the ACID properties.

I already added most 'REFERENCES'-statements to the table descriptions
in the Wiki¹ as I had to look up that information multiple times is the
past, so that might be an elegant alternative solution.

Thanks.
Philipp

¹: <https://www.mythtv.org/wiki/Category:DB_Table>


More information about the mythtv-dev mailing list