problem dropping update tables on full rebuild of database

This commit is contained in:
Ron Pedde 2005-04-28 01:07:46 +00:00
parent 27a7426bc2
commit c4c8693df9
1 changed files with 6 additions and 1 deletions

View File

@ -303,6 +303,8 @@ int db_sqlite_end_song_scan(void) {
db_sqlite_exec(E_FATAL,"drop table updated"); db_sqlite_exec(E_FATAL,"drop table updated");
} }
db_sqlite_exec(E_FATAL,"begin transaction");
db_sqlite_in_scan=0; db_sqlite_in_scan=0;
db_sqlite_in_playlist_scan=1; db_sqlite_in_playlist_scan=1;
@ -313,10 +315,12 @@ int db_sqlite_end_song_scan(void) {
* stop a db scan * stop a db scan
*/ */
int db_sqlite_end_scan(void) { int db_sqlite_end_scan(void) {
db_sqlite_exec(E_FATAL,"end transaction");
if(db_sqlite_reload) { if(db_sqlite_reload) {
db_sqlite_exec(E_FATAL,"pragma synchronous=normal"); db_sqlite_exec(E_FATAL,"pragma synchronous=normal");
} else { } else {
db_sqlite_exec(E_FATAL,"delete from playlists where ((type=%d) OR (type=%d))and " db_sqlite_exec(E_FATAL,"delete from playlists where ((type=%d) OR (type=%d)) and "
"id not in (select id from plupdated)",PL_STATICFILE,PL_STATICXML); "id not in (select id from plupdated)",PL_STATICFILE,PL_STATICXML);
db_sqlite_exec(E_FATAL,"delete from playlistitems where id not in (select distinct " db_sqlite_exec(E_FATAL,"delete from playlistitems where id not in (select distinct "
"id from playlists)"); "id from playlists)");
@ -325,6 +329,7 @@ int db_sqlite_end_scan(void) {
db_sqlite_update_playlists(); db_sqlite_update_playlists();
db_sqlite_reload=0; db_sqlite_reload=0;
db_sqlite_in_playlist_scan=0;
return 0; return 0;
} }