aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-09-16 15:06:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-09-16 15:06:32 +0200
commit21c181a6bab942b95e7b8c169fcf14acc0cbb3fd (patch)
treedda12509e782da8c91cfa994831659f1b46eb560
parentfc6e06aab1d3b08553bb1a448ec40d07b175e977 (diff)
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.
-rw-r--r--odb/mysql/statement.cxx6
1 files 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::