Added some debugging for the db wrapper.

Set some ignore directories.
This commit is contained in:
Daniel Önnerby 2008-03-20 19:15:07 +00:00
parent cc21d778b6
commit f36402a6e1
3 changed files with 22 additions and 4 deletions

View File

@ -167,7 +167,14 @@ sqlite3_stmt *Connection::GetCachedStatement(const char* sql){
StatementCache::iterator stmt = this->cachedStatements.find(sql); StatementCache::iterator stmt = this->cachedStatements.find(sql);
if(stmt==this->cachedStatements.end()){ 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; return newStmt;
} }

View File

@ -43,7 +43,13 @@
using namespace musik::core::db; using namespace musik::core::db;
Statement::Statement(const char* sql,Connection &connection) : connection(&connection),stmt(NULL){ 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) { Statement::Statement(Connection &connection) : connection(&connection),stmt(NULL) {

View File

@ -3,11 +3,16 @@
#include "stdafx.h" #include "stdafx.h"
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <core/Library/LocalDB.h> #include <core/Library/LocalDB.h>
#include <core/Query/ListSelection.h> #include <core/Query/ListSelection.h>
#include <core/tracklist/Standard.h> #include <core/tracklist/Standard.h>
#include <boost/progress.hpp> //#include <boost/progress.hpp>
#include <boost/format.hpp> #include <boost/format.hpp>
@ -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); library.AddQuery(query,Query::Wait|Query::AutoCallback);
} }