Am 10.01.2013 01:10, schrieb Lars Op den Kamp:
> In xbmc/pvr/PVRDatabase.cpp:
>
>> @@ -609,8 +609,8 @@ bool CPVRDatabase::RemoveStaleChannelsFromGroup(const CPVRChannelGroup &group)
>>    if (!group.IsInternalGroup())
>>    {
>>      /* First remove channels that don't exist in the main channels table */
>> -    CStdString strWhereClause = FormatSQL("idChannel IN (SELECT m.idChannel FROM map_channelgroups_channels m LEFT JOIN channels on m.idChannel = channels.idChannel WHERE channels.idChannel IS NULL)");
>> -    bDelete = DeleteValues("map_channelgroups_channels", strWhereClause);
>> +    CStdString strQuery = FormatSQL("DELETE m FROM map_channelgroups_channels m LEFT JOIN channels c ON (c.idChannel = m.idChannel) WHERE c.idChannel IS NULL");
>
> this should be enough:
>
> |DELETE FROM map_channelgroups_channels m LEFT JOIN channels c ON (c.idChannel = m.idChannel) WHERE c.idChannel IS NULL
> |
>
> (without m after DELETE)
>

Nope, this produces a MySQL error, as it does not know from which table 
to delete from ... My statement works, just the code is not tested ...

Cheers Jan