Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: sql/statement.cc

Issue 10171014: Changed to Reset(bool clear_bound_vars) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac build error. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sql/statement.h ('k') | sql/statement_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/statement.cc
diff --git a/sql/statement.cc b/sql/statement.cc
index 626c15b686989eec956ca175696680931d96aff4..3616dcc41449b0c23f3540dbc4db6c89d7eb8105 100644
--- a/sql/statement.cc
+++ b/sql/statement.cc
@@ -28,11 +28,11 @@ Statement::~Statement() {
// Free the resources associated with this statement. We assume there's only
// one statement active for a given sqlite3_stmt at any time, so this won't
// mess with anything.
- Reset();
+ Reset(true);
}
void Statement::Assign(scoped_refptr<Connection::StatementRef> ref) {
- Reset();
+ Reset(true);
ref_ = ref;
}
@@ -61,12 +61,13 @@ bool Statement::Step() {
return CheckError(sqlite3_step(ref_->stmt())) == SQLITE_ROW;
}
-void Statement::Reset() {
+void Statement::Reset(bool clear_bound_vars) {
if (is_valid()) {
// We don't call CheckError() here because sqlite3_reset() returns
// the last error that Step() caused thereby generating a second
// spurious error callback.
- sqlite3_clear_bindings(ref_->stmt());
+ if (clear_bound_vars)
+ sqlite3_clear_bindings(ref_->stmt());
sqlite3_reset(ref_->stmt());
}
« no previous file with comments | « sql/statement.h ('k') | sql/statement_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698