aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/extra/m_mysql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
-rw-r--r--src/modules/extra/m_mysql.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index a3a930d98..17df7ca4a 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -170,7 +170,8 @@ public:
MySQLresult(MYSQL_RES* res, unsigned long affected_rows)
: err(SQL::SUCCESS)
{
- if (affected_rows >= 1)
+ // mysql returns -1 on error even though the return type is unsigned
+ if (affected_rows >= 1 && affected_rows != (unsigned long)-1)
{
rows = int(affected_rows);
fieldlists.resize(rows);