From 21f835f30b4e092c847bf4569a00995774f7330e Mon Sep 17 00:00:00 2001 From: SomeDude Date: Fri, 1 Feb 2008 09:40:00 +0100 Subject: [PATCH] version 0.1.5 --- include/db/sqlite3db/sqlite3statement.h | 2 +- include/global.h | 2 +- include/pthreadwrapper/deadlockexception.h | 2 +- src/db/sqlite3statement.cpp | 8 +++++--- src/global.cpp | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/db/sqlite3db/sqlite3statement.h b/include/db/sqlite3db/sqlite3statement.h index 04b24a0..bdca9dc 100644 --- a/include/db/sqlite3db/sqlite3statement.h +++ b/include/db/sqlite3db/sqlite3statement.h @@ -58,7 +58,7 @@ private: static std::map m_statementcount; //std::vector textptrs; - std::vector> m_boundtext; + //std::vector > m_boundtext; }; //class diff --git a/include/global.h b/include/global.h index b2df48f..6f5445f 100644 --- a/include/global.h +++ b/include/global.h @@ -5,7 +5,7 @@ //#include #include "pthreadwrapper/thread.h" -#define FMS_VERSION "0.1.4" +#define FMS_VERSION "0.1.5" // opens database and creates tables and initial inserts if necessary void SetupDB(); diff --git a/include/pthreadwrapper/deadlockexception.h b/include/pthreadwrapper/deadlockexception.h index 3f83736..9aa12ff 100644 --- a/include/pthreadwrapper/deadlockexception.h +++ b/include/pthreadwrapper/deadlockexception.h @@ -9,7 +9,7 @@ namespace PThread class DeadlockException:public std::exception { public: - const char *what() const { return "Deadlock Exception"; } + const char *what() const throw() { return "Deadlock Exception"; } }; } // namespace diff --git a/src/db/sqlite3statement.cpp b/src/db/sqlite3statement.cpp index 538ed06..60762f0 100644 --- a/src/db/sqlite3statement.cpp +++ b/src/db/sqlite3statement.cpp @@ -54,6 +54,7 @@ Statement::~Statement() } } */ + } const bool Statement::Bind(const int column) @@ -130,9 +131,10 @@ const bool Statement::Bind(const int column, const std::string &value) //ZThread::Guard g(DB::instance()->m_mutex); PThread::Guard g(DB::Instance()->m_mutex); - m_boundtext.push_back(std::vector(value.begin(),value.end())); + //m_boundtext.push_back(std::vector(value.begin(),value.end())); //if(sqlite3_bind_text(m_statement,column+1,text,value.size(),NULL)==SQLITE_OK) - if(sqlite3_bind_text(m_statement,column+1,&m_boundtext[m_boundtext.size()-1][0],m_boundtext[m_boundtext.size()-1].size(),NULL)==SQLITE_OK) + //if(sqlite3_bind_text(m_statement,column+1,&(m_boundtext[m_boundtext.size()-1][0]),(m_boundtext[m_boundtext.size()-1]).size(),NULL)==SQLITE_OK) + if(sqlite3_bind_text(m_statement,column+1,value.c_str(),value.size(),SQLITE_TRANSIENT)==SQLITE_OK) { return true; } @@ -153,7 +155,7 @@ const bool Statement::Bind(const int column, const void *data, const int length) { //ZThread::Guard g(DB::instance()->m_mutex); PThread::Guard g(DB::Instance()->m_mutex); - if(sqlite3_bind_blob(m_statement,column+1,data,length,NULL)==SQLITE_OK) + if(sqlite3_bind_blob(m_statement,column+1,data,length,SQLITE_TRANSIENT)==SQLITE_OK) { return true; } diff --git a/src/global.cpp b/src/global.cpp index d4cc101..291f06b 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -426,13 +426,13 @@ void SetupDefaultOptions() st.Reset(); st.Bind(0,"MessageDownloadMaxDaysBackward"); - st.Bind(1,"3"); + st.Bind(1,"5"); st.Bind(2,"The maximum number of days backward that messages will be downloaded from each identity"); st.Step(); st.Reset(); st.Bind(0,"MessageListDaysBackward"); - st.Bind(1,"3"); + st.Bind(1,"5"); st.Bind(2,"The number of days backward that messages you have inserted will appear in your MessageLists"); st.Step(); st.Reset(); -- 2.7.4