diff options
author | Nathan Binkert <binkertn@umich.edu> | 2004-07-26 13:03:27 -0400 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2004-07-26 13:03:27 -0400 |
commit | ac61adef918cd80077e1f886bf73de9f2b301c0d (patch) | |
tree | 31d1b1b6c79a5e3db74a147d27c50286f266ac7a /base/mysql.cc | |
parent | a5b541150c90dce728f8f5c1696545ab6cbea22d (diff) | |
download | gem5-ac61adef918cd80077e1f886bf73de9f2b301c0d.tar.xz |
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
Diffstat (limited to 'base/mysql.cc')
-rw-r--r-- | base/mysql.cc | 13 |
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 */ } |