|
@@ -89,18 +89,21 @@ BOOL CDataImpl::Open()
|
|
|
if ( !QueryTable("mid"))
|
|
|
{
|
|
|
sqlite3_exec(m_psqlite3, _CREATE_MID_TABLE_, NULL, NULL, &psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",_CREATE_MID_TABLE_, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
}
|
|
|
|
|
|
if ( !QueryTable("keys"))
|
|
|
{
|
|
|
sqlite3_exec(m_psqlite3, _CREATE_KEYS_TABLE_, NULL, NULL, &psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",_CREATE_KEYS_TABLE_, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
}
|
|
|
|
|
|
if ( !QueryTable("log"))
|
|
|
{
|
|
|
sqlite3_exec(m_psqlite3, _CREATE_LOG_TABLE_, NULL, NULL, &psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",_CREATE_LOG_TABLE_, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
}
|
|
|
|
|
@@ -119,7 +122,7 @@ BOOL CDataImpl::ExecteSQL(IN LPCSTR lpSQL)
|
|
|
{
|
|
|
if ( lpSQL == NULL || lpSQL[0] == '\0' )
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("ExecteSQL:执行语句空!"));
|
|
|
+ Global::WriteTextLog(_T("ExecteSQL:执行语句空!"));
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
@@ -130,7 +133,7 @@ BOOL CDataImpl::ExecteSQL(IN LPCSTR lpSQL)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, lpSQL, NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("ExecteSQL:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",lpSQL, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -142,7 +145,7 @@ BOOL CDataImpl::QueryTable(std::string table)
|
|
|
{
|
|
|
if ( table.size() == 0 )
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryTable:表名空!"));
|
|
|
+ Global::WriteTextLog(_T("QueryTable:表名空!"));
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
@@ -159,7 +162,7 @@ BOOL CDataImpl::QueryTable(std::string table)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, szSql, &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryTable:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",szSql, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -187,7 +190,7 @@ INT CDataImpl::QueryMidInfo(std::string order, STMid &data)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, strSql.c_str(), &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryMidInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strSql.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return -1;
|
|
|
}
|
|
@@ -247,7 +250,7 @@ INT CDataImpl::QueryKeyInfo(std::string sn, STKeys &data)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, strSql.c_str(), &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryKeyInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strSql.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return -1;
|
|
|
}
|
|
@@ -281,7 +284,7 @@ INT CDataImpl::QueryUnReportKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, strSql.c_str(), &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryUnReportKeyInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strSql.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return -1;
|
|
|
}
|
|
@@ -312,7 +315,7 @@ INT CDataImpl::QueryLogInfo(std::string sn, STLog &data)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, _SELECT_LOG_TABLE_, &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryLogInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",_SELECT_LOG_TABLE_, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return -1;
|
|
|
}
|
|
@@ -356,7 +359,7 @@ INT CDataImpl::QueryUnReportLogInfo(std::vector<STLog> &vtdata)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, strSql.c_str(), &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryUnReportLogInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strSql.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return -1;
|
|
|
}
|
|
@@ -392,7 +395,7 @@ INT CDataImpl::QueryBidInfo(std::string order, BidInfo& binfo)
|
|
|
int sqlite_error = sqlite3_get_table(m_psqlite3, szSQL, &pazResult, &nRow, &nCol, &psqlite_error);
|
|
|
if ( sqlite_error != SQLITE_OK)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("QueryUnReportLogInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",szSQL, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return -1;
|
|
|
}
|
|
@@ -437,7 +440,7 @@ INT CDataImpl::InsertMidInfo(STMid &data)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("InsertMidInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
}
|
|
|
|
|
@@ -463,7 +466,7 @@ INT CDataImpl::InsertKeyInfo(STKeys &data)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("InsertKeyInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
}
|
|
|
|
|
@@ -490,7 +493,7 @@ INT CDataImpl::InsertLogInfo(STLog &data)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("InsertLogInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
}
|
|
|
|
|
@@ -506,6 +509,7 @@ INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
INT nRet = sqlite3_exec(m_psqlite3, "begin;", 0, 0, &psqlite_error);
|
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
|
+ Global::WriteTextLog("sqlite3 error:begin,%s", psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return nRet;
|
|
|
}
|
|
@@ -530,6 +534,8 @@ INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
{
|
|
|
// 回滚事务;
|
|
|
nRet = sqlite3_exec(m_psqlite3, "rollback;", 0, 0, &psqlite_error);
|
|
|
+ if ( nRet != SQLITE_OK )
|
|
|
+ Global::WriteTextLog("sqlite3 error:rollback,%s",psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return nRet;
|
|
|
}
|
|
@@ -537,6 +543,7 @@ INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
nRet = sqlite3_exec(m_psqlite3, "commit;", 0, 0, &psqlite_error);
|
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
|
+ Global::WriteTextLog("sqlite3 error:commit,%s",psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return nRet;
|
|
|
}
|
|
@@ -572,7 +579,7 @@ BOOL CDataImpl::UpdateMidInfo(STMid &data)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("UpdateMidInfo:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -608,7 +615,7 @@ BOOL CDataImpl::UpdateDownloadStatus(std::string order, int status, std::string
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("UpdateDownloadStatus:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -631,7 +638,7 @@ BOOL CDataImpl::UpdateKeyCopyStatus(std::string sn)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("UpdateKeyCopyStatus:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -653,7 +660,7 @@ BOOL CDataImpl::UpdateKeyReportStatus(std::string sn)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("UpdateKeyReportStatus:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -670,6 +677,7 @@ BOOL CDataImpl::BatchUpdateKeyReportStatus(std::vector<STKeys> &vtKeys)
|
|
|
INT nRet = sqlite3_exec(m_psqlite3, "begin;", 0, 0, &psqlite_error);
|
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
|
+ Global::WriteTextLog("sqlite3 error:begin,%s", psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -691,6 +699,8 @@ BOOL CDataImpl::BatchUpdateKeyReportStatus(std::vector<STKeys> &vtKeys)
|
|
|
{
|
|
|
// 回滚事务;
|
|
|
nRet = sqlite3_exec(m_psqlite3, "rollback;", 0, 0, &psqlite_error);
|
|
|
+ if ( nRet != SQLITE_OK )
|
|
|
+ Global::WriteTextLog("sqlite3 error:rollback,%s",psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -698,6 +708,7 @@ BOOL CDataImpl::BatchUpdateKeyReportStatus(std::vector<STKeys> &vtKeys)
|
|
|
nRet = sqlite3_exec(m_psqlite3, "commit;", 0, 0, &psqlite_error);
|
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
|
+ Global::WriteTextLog("sqlite3 error:commit,%s",psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -721,7 +732,7 @@ BOOL CDataImpl::UpdateLogReportStatus(std::string sn, std::string type)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("UpdateLogReportStatus:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",strInsert.c_str(), psqlite_error);
|
|
|
FREE_MSG;
|
|
|
return FALSE;
|
|
|
}
|
|
@@ -743,7 +754,7 @@ BOOL CDataImpl::RemoveBidData(std::string order)
|
|
|
int sqlite_error = sqlite3_exec(m_psqlite3, szSQL, NULL, 0, &psqlite_error);
|
|
|
if(SQLITE_OK != sqlite_error)
|
|
|
{
|
|
|
- //Global::WriteTextLog(_T("UpdateLogReportStatus:%s"), psqlite_error);
|
|
|
+ Global::WriteTextLog("sqlite3 error:%s,%s",szSQL, psqlite_error);
|
|
|
FREE_MSG;
|
|
|
// 回滚事务;
|
|
|
sqlite3_exec(m_psqlite3, "rollback;", 0, 0, &psqlite_error);
|