From 1498e89b98306a76fd0803db82acd29be1e2a636 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 21 Apr 2005 13:22:45 +0000 Subject: Updated with a bit more debug output git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1154 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sql.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/modules/extra/m_sql.cpp') diff --git a/src/modules/extra/m_sql.cpp b/src/modules/extra/m_sql.cpp index d2b5802de..1b7862281 100644 --- a/src/modules/extra/m_sql.cpp +++ b/src/modules/extra/m_sql.cpp @@ -229,6 +229,8 @@ class ModuleSQL : public Module res->SetError(i->GetError()); return; } + res->SetType(SQL_OK); + return; } } } @@ -246,17 +248,34 @@ class ModuleSQL : public Module } } + void DoneType(SQLRequest *r, SQLResult* res) + { + for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++) + { + if ((i->GetID() == r->GetConnID()) && (i->IsEnabled())) + { + res->SetType(SQL_DONE); + if (!i->QueryDone()) + res->SetType(SQL_ERROR); + } + } + } + void RowType(SQLRequest *r, SQLResult* res) { for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++) { if ((i->GetID() == r->GetConnID()) && (i->IsEnabled())) { + log(DEBUG,"*** FOUND MATCHING ROW"); std::map row = i->GetRow(); res->SetRow(row); res->SetType(SQL_ROW); if (!row.size()) + { + log(DEBUG,"ROW SIZE IS 0"); res->SetType(SQL_END); + } return; } } @@ -279,6 +298,9 @@ class ModuleSQL : public Module case SQL_ROW: RowType(r,Result); break; + case SQL_DONE: + DoneType(r,Result); + break; } return (char*)Result; } -- cgit v1.3.1-10-gc9f91