summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-23 15:49:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-23 15:49:56 +0000
commit196b1b09d32130c1806108904ded406844fd90e0 (patch)
tree06b45ba6ba31cdd0d945ca280366cc160b334ecd /src/modules
parent69790e320dcc16845a30e10a5a53ee63b26853fd (diff)
Tidyup and bugfix, not copying the correct column names
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4532 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_mysql.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index c08adfd1d..035d0b498 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -209,7 +209,6 @@ class MySQLresult : public SQLresult
SQLfieldMap fieldmap2;
SQLfieldList emptyfieldlist;
int rows;
- int cols;
public:
MySQLresult(Module* self, Module* to, MYSQL_RES* res, int affected_rows, unsigned int id) : SQLresult(self, to, id), currentrow(0), fieldmap(NULL)
@@ -334,9 +333,9 @@ class MySQLresult : public SQLresult
if (currentrow < rows)
{
- for (int i = 0; i < cols; i++)
+ for (int i = 0; i < Cols(); i++)
{
- fieldmap2.insert(std::make_pair(colnames[cols],GetValue(currentrow, i)));
+ fieldmap2.insert(std::make_pair(colnames[i],GetValue(currentrow, i)));
}
currentrow++;
}
@@ -354,6 +353,7 @@ class MySQLresult : public SQLresult
{
fieldlist->push_back(fieldlists[currentrow][i]);
}
+ currentrow++;
}
return fieldlist;
}
@@ -364,9 +364,9 @@ class MySQLresult : public SQLresult
if (currentrow < rows)
{
- for (int i = 0; i < cols; i++)
+ for (int i = 0; i < Cols(); i++)
{
- fieldmap->insert(std::make_pair(colnames[cols],GetValue(currentrow, i)));
+ fieldmap->insert(std::make_pair(colnames[i],GetValue(currentrow, i)));
}
currentrow++;
}
@@ -381,11 +381,6 @@ class MySQLresult : public SQLresult
virtual void Free(SQLfieldList* fl)
{
- /* XXX: Yes, this is SUPPOSED to do nothing, we
- * dont want to free our fieldlist until we
- * destruct the object. Unlike the pgsql module,
- * we only have the one.
- */
delete fl;
}
};