diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-22 09:29:37 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-22 09:29:37 +0000 |
commit | c4458ecc70025aeac7ca87115ed0a698e7bbcdad (patch) | |
tree | 4b81d1324857856802cf25e4017b59cf32fdbe14 /src/modules/extra | |
parent | 559d2719a37d22584dbdc2b5165ed0f7236f26f4 (diff) |
Fix test client error cheecking on result types
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4494 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_testclient.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
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; } |