aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/mysql/statement.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/odb/mysql/statement.cxx b/odb/mysql/statement.cxx
index f5379d6..816843d 100644
--- a/odb/mysql/statement.cxx
+++ b/odb/mysql/statement.cxx
@@ -120,10 +120,13 @@ namespace odb
void query_statement::
cache ()
{
- if (mysql_stmt_store_result (stmt_))
- throw database_exception (stmt_);
+ if (!cached_)
+ {
+ if (mysql_stmt_store_result (stmt_))
+ throw database_exception (stmt_);
- cached_ = true;
+ cached_ = true;
+ }
}
query_statement::result query_statement::