summaryrefslogtreecommitdiffstats
path: root/sql/statement.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 20:09:32 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 20:09:32 +0000
commit097723df58b4749b4b9cbe606f933de34ad35b30 (patch)
tree2a681070281047242a434af0b7f6fc9737ed737b /sql/statement.h
parent361abceedddbea70c1bb90e4c7ce57175a2fd9e4 (diff)
downloadchromium_src-097723df58b4749b4b9cbe606f933de34ad35b30.zip
chromium_src-097723df58b4749b4b9cbe606f933de34ad35b30.tar.gz
chromium_src-097723df58b4749b4b9cbe606f933de34ad35b30.tar.bz2
[sql] Complain about statement mutations after stepping has started.
DCHECK if any Bind*() calls occur after Step() has been called. The bind cannot be implemented at that point, so most likely the calling code has an error, such as a forgotted Reset(). Also DCHECK if Run() is called after Run() or Step() without an intervening Reset(). Such a calling sequence is unlikely to be intentional, because the results of calling Run() twice aren't defined. BUG=309759 Review URL: https://codereview.chromium.org/40733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/statement.h')
-rw-r--r--sql/statement.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/statement.h b/sql/statement.h
index 5fedc53..acf89e7 100644
--- a/sql/statement.h
+++ b/sql/statement.h
@@ -178,6 +178,11 @@ class SQL_EXPORT Statement {
// guaranteed non-NULL.
scoped_refptr<Connection::StatementRef> ref_;
+ // Set after Step() or Run() are called, reset by Reset(). Used to
+ // prevent accidental calls to API functions which would not work
+ // correctly after stepping has started.
+ bool stepped_;
+
// See Succeeded() for what this holds.
bool succeeded_;