summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_mysql.cpp10
-rw-r--r--src/modules/extra/m_sqllog.cpp2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 6825f45c1..acfdf8214 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -222,7 +222,7 @@ class MySQLresult : public SQLresult
rows = affected_rows;
fieldlists.resize(rows);
}
- unsigned int field_count;
+ unsigned int field_count = 0;
if (res)
{
MYSQL_ROW row;
@@ -247,16 +247,16 @@ class MySQLresult : public SQLresult
SQLfield sqlf(b, !row[field_count]);
colnames.push_back(a);
fieldlists[n].push_back(sqlf);
+ log(DEBUG,"Inc field count to %d",field_count+1);
field_count++;
}
n++;
}
rows++;
}
- cols = mysql_num_fields(res);
+ cols = field_count;
mysql_free_result(res);
}
- cols = field_count;
log(DEBUG, "Created new MySQL result; %d rows, %d columns", rows, cols);
}
@@ -497,6 +497,8 @@ class SQLConnection : public classbase
req.query.q = query;
pthread_mutex_unlock(&queue_mutex);
+ log(DEBUG,"REQUEST ID: %d",req.id);
+
if (!mysql_real_query(&connection, req.query.q.data(), req.query.q.length()))
{
/* Successfull query */
@@ -744,8 +746,8 @@ class ModuleSQL : public Module
if((iter = Connections.find(req->dbid)) != Connections.end())
{
- iter->second->queue.push(*req);
req->id = NewID();
+ iter->second->queue.push(*req);
returnval = SQLSUCCESS;
}
else
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index 55a74152b..b8bdd57fa 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -262,6 +262,7 @@ class ModuleSQLLog : public Module
virtual char* OnRequest(Request* request)
{
+ log(DEBUG,"OnRequest in m_sqllog.so");
if(strcmp(SQLRESID, request->GetData()) == 0)
{
SQLresult* res;
@@ -296,6 +297,7 @@ class ModuleSQLLog : public Module
QueryInfo* i = new QueryInfo(nick, host, req.id, category);
i->qs = FIND_SOURCE;
active_queries[req.id] = i;
+ log(DEBUG,"Active query id %d",req.id);
}
else
{