From 57d5d8fe9dc4c0d6b4ef21754c5a3539e4c01cf9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Nov 2011 15:00:06 +0200 Subject: Add support for SQL statement tracing --- odb/mysql/statement.hxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'odb/mysql/statement.hxx') diff --git a/odb/mysql/statement.hxx b/odb/mysql/statement.hxx index 93adea4..ee1284b 100644 --- a/odb/mysql/statement.hxx +++ b/odb/mysql/statement.hxx @@ -12,7 +12,7 @@ #include // std::size_t #include -#include +#include #include #include @@ -27,12 +27,21 @@ namespace odb { class connection; - class LIBODB_MYSQL_EXPORT statement: public details::shared_base + class LIBODB_MYSQL_EXPORT statement: public odb::statement { public: virtual ~statement () = 0; + MYSQL_STMT* + handle () const + { + return stmt_; + } + + virtual const char* + text () const; + // Cancel the statement execution (e.g., result fetching) so // that another statement can be executed on the connection. // @@ -40,10 +49,11 @@ namespace odb cancel (); protected: - statement (connection&); + statement (connection&, const std::string& text); protected: connection& conn_; + const std::string text_; auto_handle stmt_; }; -- cgit v1.1