[videodb] Fix MySQL breakage when cleaning up path table during video library clean
authorMilhouseVH <milhouseVH.github@nmacleod.com>
Fri, 11 Jul 2014 23:47:20 +0000 (00:47 +0100)
committerMilhouseVH <milhouseVH.github@nmacleod.com>
Sat, 12 Jul 2014 09:33:04 +0000 (10:33 +0100)
xbmc/video/VideoDatabase.cpp

index bf8c217..5b4669f 100644 (file)
@@ -8075,7 +8075,7 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
                                   "AND (strSettings IS NULL OR strSettings = '') "
                                   "AND (strHash IS NULL OR strHash = '') "
                                   "AND (exclude IS NULL OR exclude != 1) "
-                                  "AND (idParentPath IS NULL OR NOT EXISTS (SELECT 1 FROM path AS parentPath WHERE parentPath.idPath = path.idParentPath)) "
+                                  "AND (idParentPath IS NULL OR NOT EXISTS (SELECT 1 FROM (SELECT idPath FROM path) as parentPath WHERE parentPath.idPath = path.idParentPath)) " // MySQL only fix (#5007)
                                   "AND NOT EXISTS (SELECT 1 FROM files WHERE files.idPath = path.idPath) "
                                   "AND NOT EXISTS (SELECT 1 FROM tvshowlinkpath WHERE tvshowlinkpath.idPath = path.idPath) "
                                   "AND NOT EXISTS (SELECT 1 FROM movie WHERE movie.c%02d = path.idPath) "