From c4c8693df92bebc008cc446bc887ab8915f61624 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Thu, 28 Apr 2005 01:07:46 +0000 Subject: [PATCH] problem dropping update tables on full rebuild of database --- src/dbs-sqlite.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dbs-sqlite.c b/src/dbs-sqlite.c index 6d0bc2f8..49f1675c 100644 --- a/src/dbs-sqlite.c +++ b/src/dbs-sqlite.c @@ -303,6 +303,8 @@ int db_sqlite_end_song_scan(void) { db_sqlite_exec(E_FATAL,"drop table updated"); } + db_sqlite_exec(E_FATAL,"begin transaction"); + db_sqlite_in_scan=0; db_sqlite_in_playlist_scan=1; @@ -313,10 +315,12 @@ int db_sqlite_end_song_scan(void) { * stop a db scan */ int db_sqlite_end_scan(void) { + db_sqlite_exec(E_FATAL,"end transaction"); + if(db_sqlite_reload) { db_sqlite_exec(E_FATAL,"pragma synchronous=normal"); } 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); db_sqlite_exec(E_FATAL,"delete from playlistitems where id not in (select distinct " "id from playlists)"); @@ -325,6 +329,7 @@ int db_sqlite_end_scan(void) { db_sqlite_update_playlists(); db_sqlite_reload=0; + db_sqlite_in_playlist_scan=0; return 0; }