From ac61adef918cd80077e1f886bf73de9f2b301c0d Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 26 Jul 2004 13:03:27 -0400 Subject: Move the query function to the cc file and make trace stuff work base/mysql.cc: Move the query function to the cc file make the trace stuff work base/mysql.hh: Move the query function to the cc file --HG-- extra : convert_revision : c47cb12afa47d3fe4a7a031b3563601adab62913 --- base/mysql.cc | 13 +++++++++++++ base/mysql.hh | 11 +---------- 2 files changed, 14 insertions(+), 10 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 #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 */ } diff --git a/base/mysql.hh b/base/mysql.hh index 23edb878c..58a1bf7c2 100644 --- a/base/mysql.hh +++ b/base/mysql.hh @@ -177,16 +177,7 @@ class Connection operator MYSQL *() { return &mysql; } public: - bool - query(const std::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; - } + bool query(const std::string &sql); bool query(const std::stringstream &sql) -- cgit v1.2.3