From f79756769a021ae315258b532bf5d2999575c5e9 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 6 Mar 2006 08:29:58 +0000 Subject: [PATCH] more attempts at sqlite3 fixage --- src/db-sql-sqlite3.c | 12 ++++++------ src/db-sql.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/db-sql-sqlite3.c b/src/db-sql-sqlite3.c index 4270344c..d4afffd4 100644 --- a/src/db-sql-sqlite3.c +++ b/src/db-sql-sqlite3.c @@ -1,6 +1,6 @@ /* * $Id$ - * sqlite2-specific db implementation + * sqlite3-specific db implementation * * Copyright (C) 2005 Ron Pedde (ron@pedde.com) * @@ -415,7 +415,7 @@ int db_sqlite3_event(int event_type) { case DB_SQL_EVENT_SONGSCANSTART: if(db_sqlite3_reload) { db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off"); - db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); +// 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)"); @@ -426,7 +426,7 @@ int db_sqlite3_event(int event_type) { case DB_SQL_EVENT_SONGSCANEND: if(db_sqlite3_reload) { - db_sqlite3_exec(NULL,E_FATAL,"commit transaction"); +// db_sqlite3_exec(NULL,E_FATAL,"commit transaction"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_path on songs(path)"); db_sqlite3_exec(NULL,E_DBG,"delete from config where term='rescan'"); } else { @@ -437,13 +437,13 @@ int db_sqlite3_event(int event_type) { break; case DB_SQL_EVENT_PLSCANSTART: - if(db_sqlite3_reload) - db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); +// if(db_sqlite3_reload) +// db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); break; case DB_SQL_EVENT_PLSCANEND: if(db_sqlite3_reload) { - db_sqlite3_exec(NULL,E_FATAL,"end transaction"); +// db_sqlite3_exec(NULL,E_FATAL,"end transaction"); db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid)"); diff --git a/src/db-sql.c b/src/db-sql.c index 8e9308a8..0255b378 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -179,7 +179,7 @@ int db_sql_fetch_int(char **pe, int *result, char *fmt, ...) { db_sql_vmfree_fn(query); if(err != DB_E_SUCCESS) { - DPRINTF(E_SPAM,L_DB,"fetch_row failed in fetch_int: %s\n",*pe); + DPRINTF(E_SPAM,L_DB,"fetch_row failed in fetch_int: %s\n",pe ? *pe : NULL); return err; }