Fix #73 Wrong exception thrown by Database constructor

- switched from sqlite3_errmsg() to sqlite3_errstr() where applicable
This commit is contained in:
Sébastien Rombauts
2015-11-10 18:32:24 +01:00
parent 24153e5293
commit b7b440de5d
5 changed files with 9 additions and 13 deletions

View File

@@ -195,7 +195,7 @@ bool Statement::executeStep()
{
mbOk = false;
mbDone = false;
throw SQLite::Exception(sqlite3_errmsg(mStmtPtr));
throw SQLite::Exception(sqlite3_errstr(ret));
}
}
else
@@ -227,7 +227,7 @@ int Statement::exec()
{
mbOk = false;
mbDone = false;
throw SQLite::Exception(sqlite3_errmsg(mStmtPtr));
throw SQLite::Exception(sqlite3_errstr(ret));
}
}
else
@@ -317,7 +317,7 @@ Statement::Ptr::Ptr(sqlite3* apSQLite, std::string& aQuery) :
const int ret = sqlite3_prepare_v2(apSQLite, aQuery.c_str(), static_cast<int>(aQuery.size()), &mpStmt, NULL);
if (SQLITE_OK != ret)
{
throw SQLite::Exception(sqlite3_errmsg(mpSQLite));
throw SQLite::Exception(sqlite3_errstr(ret));
}
// Initialize the reference counter of the sqlite3_stmt :
// used to share the mStmtPtr between Statement and Column objects;