From e8b1520ffc1e9ef81917755e542a4f8ae9409f55 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Thu, 17 Aug 2006 05:05:48 +0000 Subject: [PATCH] Change db safety outside transactions --- src/db-sql-sqlite2.c | 8 ++++---- src/db-sql-sqlite3.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/db-sql-sqlite2.c b/src/db-sql-sqlite2.c index b43dea29..cb546d30 100644 --- a/src/db-sql-sqlite2.c +++ b/src/db-sql-sqlite2.c @@ -354,8 +354,8 @@ int db_sqlite2_event(int event_type) { case DB_SQL_EVENT_SONGSCANSTART: if(db_sqlite2_reload) { - db_sqlite2_exec(NULL,E_FATAL,"begin transaction"); db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous = off"); + db_sqlite2_exec(NULL,E_FATAL,"begin transaction"); } else { db_sqlite2_exec(NULL,E_DBG,"drop table updated"); db_sqlite2_exec(NULL,E_FATAL,"create temp table updated (id int)"); @@ -366,21 +366,21 @@ int db_sqlite2_event(int event_type) { case DB_SQL_EVENT_SONGSCANEND: if(db_sqlite2_reload) { - db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite2_exec(NULL,E_FATAL,"commit transaction"); + db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite2_exec(NULL,E_FATAL,"create index idx_path on songs(path,idx)"); db_sqlite2_exec(NULL,E_DBG,"delete from config where term='rescan'"); } break; case DB_SQL_EVENT_PLSCANSTART: - db_sqlite2_exec(NULL,E_FATAL,"begin transaction"); db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous = off"); + db_sqlite2_exec(NULL,E_FATAL,"begin transaction"); break; case DB_SQL_EVENT_PLSCANEND: - db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite2_exec(NULL,E_FATAL,"end transaction"); + db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal"); if(db_sqlite2_reload) { db_sqlite2_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)"); diff --git a/src/db-sql-sqlite3.c b/src/db-sql-sqlite3.c index 54eb206d..47ef96d5 100644 --- a/src/db-sql-sqlite3.c +++ b/src/db-sql-sqlite3.c @@ -386,8 +386,8 @@ int db_sqlite3_event(int event_type) { case DB_SQL_EVENT_SONGSCANSTART: if(db_sqlite3_reload) { - db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off"); + db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); } else { db_sqlite3_exec(NULL,E_DBG,"drop table updated"); db_sqlite3_exec(NULL,E_FATAL,"create temp table updated (id int)"); @@ -398,21 +398,21 @@ int db_sqlite3_event(int event_type) { case DB_SQL_EVENT_SONGSCANEND: if(db_sqlite3_reload) { - db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = normal"); db_sqlite3_exec(NULL,E_FATAL,"commit transaction"); + db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = normal"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_path on songs(path,idx)"); db_sqlite3_exec(NULL,E_DBG,"delete from config where term='rescan'"); } break; case DB_SQL_EVENT_PLSCANSTART: - db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off"); + db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); break; case DB_SQL_EVENT_PLSCANEND: - db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite3_exec(NULL,E_FATAL,"end transaction"); + db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal"); if(db_sqlite3_reload) { db_sqlite3_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)");