diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-09-20 14:24:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-09-20 14:24:18 +0200 |
commit | 03451ab37228b5be863c27f0a8dc8782826f0300 (patch) | |
tree | 860a117a2c99198a18f9c419bf01039a79637317 | |
parent | 2e39895e727689e88608fd909d4ec77c28ca4ff0 (diff) |
Cache result by default
-rw-r--r-- | odb/mysql/statement.cxx | 9 |
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:: |