more attempts at sqlite3 fixage

This commit is contained in:
Ron Pedde 2006-03-06 08:29:58 +00:00
parent f037a53452
commit f79756769a
2 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/* /*
* $Id$ * $Id$
* sqlite2-specific db implementation * sqlite3-specific db implementation
* *
* Copyright (C) 2005 Ron Pedde (ron@pedde.com) * Copyright (C) 2005 Ron Pedde (ron@pedde.com)
* *
@ -415,7 +415,7 @@ int db_sqlite3_event(int event_type) {
case DB_SQL_EVENT_SONGSCANSTART: case DB_SQL_EVENT_SONGSCANSTART:
if(db_sqlite3_reload) { if(db_sqlite3_reload) {
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off"); 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 { } else {
db_sqlite3_exec(NULL,E_DBG,"drop table updated"); db_sqlite3_exec(NULL,E_DBG,"drop table updated");
db_sqlite3_exec(NULL,E_FATAL,"create temp table updated (id int)"); 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: case DB_SQL_EVENT_SONGSCANEND:
if(db_sqlite3_reload) { 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_FATAL,"create index idx_path on songs(path)");
db_sqlite3_exec(NULL,E_DBG,"delete from config where term='rescan'"); db_sqlite3_exec(NULL,E_DBG,"delete from config where term='rescan'");
} else { } else {
@ -437,13 +437,13 @@ int db_sqlite3_event(int event_type) {
break; break;
case DB_SQL_EVENT_PLSCANSTART: case DB_SQL_EVENT_PLSCANSTART:
if(db_sqlite3_reload) // if(db_sqlite3_reload)
db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); // db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
break; break;
case DB_SQL_EVENT_PLSCANEND: case DB_SQL_EVENT_PLSCANEND:
if(db_sqlite3_reload) { 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,"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_songid on playlistitems(songid)");
db_sqlite3_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid)"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid)");

View File

@ -179,7 +179,7 @@ int db_sql_fetch_int(char **pe, int *result, char *fmt, ...) {
db_sql_vmfree_fn(query); db_sql_vmfree_fn(query);
if(err != DB_E_SUCCESS) { 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; return err;
} }