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
This commit is contained in:
parent
a5b541150c
commit
ac61adef91
2 changed files with 14 additions and 10 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "base/mysql.hh"
|
#include "base/mysql.hh"
|
||||||
|
#include "base/trace.hh"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -94,4 +95,16 @@ Connection::close()
|
||||||
mysql_close(&mysql);
|
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 */ }
|
/* namespace MySQL */ }
|
||||||
|
|
|
@ -177,16 +177,7 @@ class Connection
|
||||||
operator MYSQL *() { return &mysql; }
|
operator MYSQL *() { return &mysql; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool
|
bool query(const std::string &sql);
|
||||||
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
|
bool
|
||||||
query(const std::stringstream &sql)
|
query(const std::stringstream &sql)
|
||||||
|
|
Loading…
Reference in a new issue