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