[mythtv-users] Failed database update 1327->1328
Stephen Worthington
stephen_agent at jsw.gen.nz
Mon Jun 23 09:39:52 UTC 2014
On Mon, 23 Jun 2014 17:56:22 +1000, you wrote:
>Gary Buhrmaster wrote:
>> Those that want to do check to see if they are going to
>> have issues can try to run a sql query of the form (only
>> written, never actually run/tested, and not really efficient):
>> select * from record as p1 where (select count(*) from record as
>> p2
>> where p1.chanid = p2.chanid and p1.starttime = p2.starttime and
>> p1.startdate = p2.startdate and p1.title = p2.title and p1.type
>> =
>> p2.type) > 1;
>
>Probably academic, but likely more efficient, and a useful lesson
>for anyone interested in SQL:
>
>SELECT chanid, starttime, startdate, title, COUNT(*)
>FROM record
>GROUP BY chanid, starttime, startdate, title
>HAVING COUNT(*) > 1
>ORDER BY 1, 2, 3, 4;
>
>
>For the record, my database returned zero rows!
That query gives me 10 rows each with count = 2. So there must have
been a problem in the past that has allowed duplicate rows to be
created. I think this will need to be fixed for smooth upgrading to
0.28 when it is released.
More information about the mythtv-users
mailing list