summaryrefslogtreecommitdiff
path: root/base/mysql.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/mysql.cc')
-rw-r--r--base/mysql.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/base/mysql.cc b/base/mysql.cc
index 8481e74e2..15e12fdeb 100644
--- a/base/mysql.cc
+++ b/base/mysql.cc
@@ -29,6 +29,7 @@
#include <iostream>
#include "base/mysql.hh"
+#include "base/trace.hh"
using namespace std;
@@ -94,4 +95,16 @@ Connection::close()
mysql_close(&mysql);
}
+bool
+Connection::query(const string &sql)
+{
+ DPRINTF(SQL, "Sending SQL query to server:\n%s", sql);
+ error.clear();
+ if (mysql_real_query(&mysql, sql.c_str(), sql.size()))
+ error.set(mysql_error(&mysql));
+
+ return error;
+}
+
+
/* namespace MySQL */ }