summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-04-30 21:57:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-04-30 21:57:10 +0000
commite971d1a413c6454bb305f76c331385fe39b2ca6b (patch)
tree96a05e854ef01057249dc1b50caad669a39a44e9 /src/modules/extra
parent79a2655915baad60ad6061aabaa0010922a8a4be (diff)
In 1.1, we return a negative value when QueryCount has a downed connection - not changed in 1.0 for backwards compatibility
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3920 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_sql.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/extra/m_sql.cpp b/src/modules/extra/m_sql.cpp
index be43910de..d958e9092 100644
--- a/src/modules/extra/m_sql.cpp
+++ b/src/modules/extra/m_sql.cpp
@@ -92,9 +92,10 @@ class SQLConnection
// This method issues a query that just expects a number of 'effected' rows (e.g. UPDATE or DELETE FROM).
// the number of effected rows is returned in the return value.
- unsigned long QueryCount(std::string query)
+ long QueryCount(std::string query)
{
- if (!CheckConnection()) return 0;
+ /* If the connection is down, we return a negative value - New to 1.1 */
+ if (!CheckConnection()) return -1;
int r = mysql_query(&connection, query.c_str());
if (!r)