[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mythtv-dev
Subject:    Re: [mythtv] Missed recordings caused by EIT guide update
From:       Philipp Hahn <pmhahn+mythtv () pmhahn ! de>
Date:       2019-09-12 5:17:24
Message-ID: 20190912051724.GA3654 () fixa ! knut ! univention ! de
[Download RAW message or body]

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 a=
nymore.
> The solution for this, as implemented in the EIT update code in programda=
ta.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 t=
hat
> 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=B9 as I had to look up that information multiple times is the
past, so that might be an elegant alternative solution.

Thanks.
Philipp

=B9: <https://www.mythtv.org/wiki/Category:DB_Table>
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic