From 21c181a6bab942b95e7b8c169fcf14acc0cbb3fd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Sep 2014 15:06:32 +0200 Subject: Call tracer::prepare() before actually preparing statement This way we give the user the ability to see an invalid statement that would cause the preparation step to fail. --- odb/mysql/statement.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/odb/mysql/statement.cxx b/odb/mysql/statement.cxx index 6fc57b9..afc6656 100644 --- a/odb/mysql/statement.cxx +++ b/odb/mysql/statement.cxx @@ -113,9 +113,6 @@ namespace odb conn_.clear (); - if (mysql_stmt_prepare (stmt_, text_, text_size) != 0) - translate_error (conn_, stmt_); - { odb::tracer* t; if ((t = conn_.transaction_tracer ()) || @@ -123,6 +120,9 @@ namespace odb (t = conn_.database ().tracer ())) t->prepare (conn_, *this); } + + if (mysql_stmt_prepare (stmt_, text_, text_size) != 0) + translate_error (conn_, stmt_); } size_t statement:: -- cgit v1.1