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

Unified Diff: sql/connection.h

Issue 24638002: [sql] Log tag with sqlite errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Log the sql statement, too. Created 7 years, 3 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 | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index 793860642283aa7b70ff5e9a2f641d83eda4defb..c0588523e8d698b391943dd864110f3419a83ee2 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -511,9 +511,17 @@ class SQL_EXPORT Connection {
void StatementRefCreated(StatementRef* ref);
void StatementRefDeleted(StatementRef* ref);
- // Called by Statement objects when an sqlite function returns an error.
- // The return value is the error code reflected back to client code.
- int OnSqliteError(int err, Statement* stmt);
+ // Called when a sqlite function returns an error, which is passed
+ // as |err|. The return value is the error code to be reflected
+ // back to client code. |stmt| is non-NULL if the error relates to
+ // an sql::Statement instance. |sql| is non-NULL if the error
+ // relates to non-statement sql code (Execute, for instance). Both
+ // can be NULL, but both should never be set.
+ // NOTE(shess): Originally, the return value was intended to allow
+ // error handlers to transparently convert errors into success.
+ // Unfortunately, transactions are not generally restartable, so
+ // this did not work out.
+ int OnSqliteError(int err, Statement* stmt, const char* sql);
// Like |Execute()|, but retries if the database is locked.
bool ExecuteWithTimeout(const char* sql, base::TimeDelta ms_timeout)
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698