From c4458ecc70025aeac7ca87115ed0a698e7bbcdad Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 22 Jul 2006 09:29:37 +0000 Subject: Fix test client error cheecking on result types git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4494 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_testclient.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/modules/extra/m_testclient.cpp b/src/modules/extra/m_testclient.cpp index 069c21c0b..a776fc490 100644 --- a/src/modules/extra/m_testclient.cpp +++ b/src/modules/extra/m_testclient.cpp @@ -55,18 +55,26 @@ public: log(DEBUG, "Got SQL result (%s)", request->GetData()); SQLresult* res = (SQLresult*)request; - - log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); - - for (int r = 0; r < res->Rows(); r++) + + if (res->error.Id() != NO_ERROR) { - log(DEBUG, "Row %d:", r); - - for(int i = 0; i < res->Cols(); i++) + log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols()); + + for (int r = 0; r < res->Rows(); r++) { - log(DEBUG, "\t[%s]: %s", res->ColName(i).c_str(), res->GetValue(r, i).d.c_str()); + log(DEBUG, "Row %d:", r); + + for(int i = 0; i < res->Cols(); i++) + { + log(DEBUG, "\t[%s]: %s", res->ColName(i).c_str(), res->GetValue(r, i).d.c_str()); + } } } + else + { + log(DEBUG, "SQLrequest failed: %s", res->error.Str()); + + } return SQLSUCCESS; } -- cgit v1.2.3