From f36402a6e1842734e8a9fb69ca3e8b6b5985327d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96nnerby?= Date: Thu, 20 Mar 2008 19:15:07 +0000 Subject: [PATCH] Added some debugging for the db wrapper. Set some ignore directories. --- src/core/db/Connection.cpp | 9 ++++++++- src/core/db/Statement.cpp | 8 +++++++- src/core/test_project/test_project.cpp | 9 +++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/core/db/Connection.cpp b/src/core/db/Connection.cpp index 1b95c0e90..32c1a200e 100644 --- a/src/core/db/Connection.cpp +++ b/src/core/db/Connection.cpp @@ -167,7 +167,14 @@ sqlite3_stmt *Connection::GetCachedStatement(const char* sql){ StatementCache::iterator stmt = this->cachedStatements.find(sql); if(stmt==this->cachedStatements.end()){ - DB_ASSERT(sqlite3_prepare_v2(this->connection,sql,-1,&newStmt,NULL)); + + int err = sqlite3_prepare_v2(this->connection,sql,-1,&newStmt,NULL); + #ifdef _DEBUG + if(err!=0){ + const char *errorMsg = sqlite3_errmsg(this->connection); + _ASSERT(false); + } + #endif return newStmt; } diff --git a/src/core/db/Statement.cpp b/src/core/db/Statement.cpp index ca476b2e2..fd1d8dd00 100644 --- a/src/core/db/Statement.cpp +++ b/src/core/db/Statement.cpp @@ -43,7 +43,13 @@ using namespace musik::core::db; Statement::Statement(const char* sql,Connection &connection) : connection(&connection),stmt(NULL){ - DB_ASSERT( sqlite3_prepare_v2(this->connection->connection,sql,-1,&this->stmt,NULL)); + int err = sqlite3_prepare_v2(this->connection->connection,sql,-1,&this->stmt,NULL); + #ifdef _DEBUG + if(err!=0){ + const char *errorMsg = sqlite3_errmsg(this->connection->connection); + _ASSERT(false); + } + #endif } Statement::Statement(Connection &connection) : connection(&connection),stmt(NULL) { diff --git a/src/core/test_project/test_project.cpp b/src/core/test_project/test_project.cpp index 2aa279755..83dd59d46 100644 --- a/src/core/test_project/test_project.cpp +++ b/src/core/test_project/test_project.cpp @@ -3,11 +3,16 @@ #include "stdafx.h" +#include +#include +#include +#include + #include #include #include -#include +//#include #include @@ -52,7 +57,7 @@ int _tmain(int argc, _TCHAR* argv[]) { - boost::progress_timer timer; +// boost::progress_timer timer; library.AddQuery(query,Query::Wait|Query::AutoCallback); }