Merging like a zip!
This commit is contained in:
commit
3c12db8637
@ -415,7 +415,18 @@ bool ClientPrefs::AddQueryToQueue( TQueryOp *query )
|
|||||||
{
|
{
|
||||||
query->SetDatabase(Database);
|
query->SetDatabase(Database);
|
||||||
query->SetPreparedQuery();
|
query->SetPreparedQuery();
|
||||||
|
if (query->GetQuery() == NULL && query->GetType() != Query_Connect)
|
||||||
|
{
|
||||||
|
g_pSM->LogError(myself, "Invalid aqtq query %d being inserted! glorp: %p, %p",
|
||||||
|
query->GetType(),
|
||||||
|
query->GetDriver(),
|
||||||
|
query);
|
||||||
|
query->Destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
dbi->AddToThreadQueue(query, PrioQueue_Normal);
|
dbi->AddToThreadQueue(query, PrioQueue_Normal);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,17 +446,28 @@ void ClientPrefs::ProcessQueryCache()
|
|||||||
|
|
||||||
while (iter != cachedQueries.end())
|
while (iter != cachedQueries.end())
|
||||||
{
|
{
|
||||||
TQueryOp *op = (TQueryOp *)*iter;
|
TQueryOp *op = *iter;
|
||||||
|
|
||||||
if (Database != NULL)
|
if (Database != NULL)
|
||||||
{
|
{
|
||||||
op->SetDatabase(Database);
|
op->SetDatabase(Database);
|
||||||
op->SetPreparedQuery();
|
op->SetPreparedQuery();
|
||||||
dbi->AddToThreadQueue(op, PrioQueue_Normal);
|
if (op->GetQuery() == NULL && op->GetType() != Query_Connect)
|
||||||
|
{
|
||||||
|
g_pSM->LogError(myself, "Invalid pqc query %d being inserted! glorp: %p, %p",
|
||||||
|
op->GetType(),
|
||||||
|
op->GetDriver(),
|
||||||
|
op);
|
||||||
|
op->Destroy();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete op;
|
dbi->AddToThreadQueue(op, PrioQueue_Normal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
op->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
iter++;
|
||||||
|
@ -79,10 +79,7 @@ void TQueryOp::RunThreadPart()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_database == NULL)
|
assert(m_database != NULL);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_database->LockForFullAtomicOperation();
|
m_database->LockForFullAtomicOperation();
|
||||||
|
|
||||||
@ -99,10 +96,7 @@ void TQueryOp::RunThreadPart()
|
|||||||
|
|
||||||
IDBDriver *TQueryOp::GetDriver()
|
IDBDriver *TQueryOp::GetDriver()
|
||||||
{
|
{
|
||||||
if (m_database == NULL)
|
assert(m_database != NULL);
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_database->GetDriver();
|
return m_database->GetDriver();
|
||||||
}
|
}
|
||||||
@ -140,9 +134,12 @@ void TQueryOp::SetDatabase( IDatabase *db )
|
|||||||
|
|
||||||
bool TQueryOp::BindParamsAndRun()
|
bool TQueryOp::BindParamsAndRun()
|
||||||
{
|
{
|
||||||
|
assert(m_pQuery != NULL);
|
||||||
|
|
||||||
|
/* :TODO: remove this check. */
|
||||||
if (m_pQuery == NULL)
|
if (m_pQuery == NULL)
|
||||||
{
|
{
|
||||||
g_pSM->LogError(myself, "Attempted to run with a NULL Query");
|
g_pSM->LogError(myself, "Attempted to run with a NULL Query (type %d)", m_type);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +227,6 @@ void TQueryOp::SetPreparedQuery()
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +91,21 @@ public:
|
|||||||
/* Params to be bound */
|
/* Params to be bound */
|
||||||
ParamData m_params;
|
ParamData m_params;
|
||||||
|
|
||||||
|
inline IPreparedQuery *GetQuery()
|
||||||
|
{
|
||||||
|
return m_pQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline querytype GetType()
|
||||||
|
{
|
||||||
|
return m_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline IDatabase *GetDB()
|
||||||
|
{
|
||||||
|
return m_database;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IPreparedQuery *m_pQuery;
|
IPreparedQuery *m_pQuery;
|
||||||
IDatabase *m_database;
|
IDatabase *m_database;
|
||||||
|
Loading…
Reference in New Issue
Block a user