Skip to content
This repository
Browse code

Merge pull request #2056 from skywalker666/master

Issue #13810: This should fix the DELETE statement for MySQL (UNTESTED!).
  • Loading branch information...
commit a72b57bfc3165312f898858ca3ef1aa1dad6b05a 2 parents c79c5d5 + 7e0a425
Lars Op den Kamp authored January 10, 2013

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  xbmc/pvr/PVRDatabase.cpp
4  xbmc/pvr/PVRDatabase.cpp
@@ -609,8 +609,8 @@ bool CPVRDatabase::RemoveStaleChannelsFromGroup(const CPVRChannelGroup &group)
609 609
   if (!group.IsInternalGroup())
610 610
   {
611 611
     /* First remove channels that don't exist in the main channels table */
612  
-    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)");
613  
-    bDelete = DeleteValues("map_channelgroups_channels", strWhereClause);
  612
+    CStdString strQuery = FormatSQL("DELETE m FROM map_channelgroups_channels m LEFT JOIN channels c ON (c.idChannel = m.idChannel) WHERE c.idChannel IS NULL");
  613
+    bDelete = ExecuteQuery(strQuery);
614 614
   }
615 615
 
616 616
   if (group.m_members.size() > 0)

1 note on commit a72b57b

Lars Op den Kamp
Collaborator

@skywalker666 please don't put this "UNTESTED!" stuff in the commit note for a PR next time, only in the PR description if it wasn't tested.

Please sign in to comment.
Something went wrong with that request. Please try again.