From e971d1a413c6454bb305f76c331385fe39b2ca6b Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 30 Apr 2006 21:57:10 +0000 Subject: 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 --- src/modules/extra/m_sql.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules') 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) -- cgit v1.2.3