1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Update Data.cpp
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Sandu Liviu Catalin 2022-07-19 20:03:00 +03:00
parent fa9c3a5821
commit ebe60ebf4b

View File

@ -568,24 +568,20 @@ struct SQLiteAsyncExec : public ThreadPoolItem
*/ */
SQMOD_NODISCARD bool OnProcess() override SQMOD_NODISCARD bool OnProcess() override
{ {
OutputError("query process begin");
char * err_msg = nullptr; char * err_msg = nullptr;
// Attempt to execute the specified query // Attempt to execute the specified query
mResult = sqlite3_exec(mConnection, mQueryStr, nullptr, nullptr, &err_msg); mResult = sqlite3_exec(mConnection, mQueryStr, nullptr, nullptr, &err_msg);
OutputError("query process check");
// Store changes count // Store changes count
if (mResult == SQLITE_OK) if (mResult == SQLITE_OK)
{ {
mChanges = sqlite3_changes(mConnection); mChanges = sqlite3_changes(mConnection);
} }
OutputError("query process remember");
// Check for error message // Check for error message
if (err_msg != nullptr) if (err_msg != nullptr)
{ {
mError.assign(err_msg); mError.assign(err_msg);
sqlite3_free(err_msg); sqlite3_free(err_msg);
} }
OutputError("query process completed");
// Don't retry // Don't retry
return false; return false;
}; };
@ -597,7 +593,6 @@ struct SQLiteAsyncExec : public ThreadPoolItem
{ {
if (mResult == SQLITE_OK) if (mResult == SQLITE_OK)
{ {
OutputError("result was ok");
if (!mResolved.IsNull()) if (!mResolved.IsNull())
{ {
SQLiteConnRef conn_ref{new SQLiteConnHnd(std::move(mSession))}; SQLiteConnRef conn_ref{new SQLiteConnHnd(std::move(mSession))};
@ -607,13 +602,10 @@ struct SQLiteAsyncExec : public ThreadPoolItem
} }
else if (!mRejected.IsNull()) else if (!mRejected.IsNull())
{ {
OutputError("result was bad");
SQLiteConnRef conn_ref{new SQLiteConnHnd(std::move(mSession))}; SQLiteConnRef conn_ref{new SQLiteConnHnd(std::move(mSession))};
OutputError("handle created");
LightObj connection{SqTypeIdentity< SQLiteConnection >{}, SqVM(), conn_ref}; LightObj connection{SqTypeIdentity< SQLiteConnection >{}, SqVM(), conn_ref};
OutputError("object is ready");
mRejected.Execute(connection, mResult, mError, mQueryObj); mRejected.Execute(connection, mResult, mError, mQueryObj);
OutputError("callback finished");
} }
} }