diff options
Diffstat (limited to 'sql/connection.cc')
-rw-r--r-- | sql/connection.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/connection.cc b/sql/connection.cc index f08560c..f94e7ab 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -268,7 +268,15 @@ void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) { std::string debug_info; const int error = (extended_error & 0xFF); if (error == SQLITE_CORRUPT) { + // CollectCorruptionInfo() is implemented in terms of sql::Connection, + // prevent reentrant calls to the error callback. + // TODO(shess): Rewrite IntegrityCheckHelper() in terms of raw SQLite. + ErrorCallback original_callback = std::move(error_callback_); + reset_error_callback(); + debug_info = CollectCorruptionInfo(); + + error_callback_ = std::move(original_callback); } else { debug_info = CollectErrorInfo(extended_error, stmt); } |