Skip to content
Browse files

[musicdb] use a temporary table for the updating of strJoinPhrase in …

…song_artist and album_artist, as mysql can't handle (potentially) circular updates
  • Loading branch information...
1 parent 30c9e1b commit a1f845c2f07504fb0fe2c04cef5597d0da6f7da0 Jonathan Marshall committed Dec 29, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 xbmc/music/MusicDatabase.cpp
View
4 xbmc/music/MusicDatabase.cpp
@@ -4098,8 +4098,8 @@ bool CMusicDatabase::UpdateOldVersion(int version)
m_pDS->next();
}
// drop the last separator if more than one
- m_pDS->exec("UPDATE song_artist SET strJoinPhrase = '' WHERE 100*idSong+iOrder IN (select 100*idSong+max(iOrder) FROM song_artist GROUP BY idSong)");
- m_pDS->exec("UPDATE album_artist SET strJoinPhrase = '' WHERE 100*idAlbum+iOrder IN (select 100*idAlbum+max(iOrder) FROM album_artist GROUP BY idAlbum)");
+ m_pDS->exec("UPDATE song_artist SET strJoinPhrase = '' WHERE 100*idSong+iOrder IN (SELECT id FROM (SELECT 100*idSong+max(iOrder) AS id FROM song_artist GROUP BY idSong) AS sub)");
+ m_pDS->exec("UPDATE album_artist SET strJoinPhrase = '' WHERE 100*idAlbum+iOrder IN (SELECT id FROM (SELECT 100*idAlbum+max(iOrder) AS id FROM album_artist GROUP BY idAlbum) AS sub)");
}
if (version < 43)
{ // (re)create triggers

0 comments on commit a1f845c

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