diff options
Diffstat (limited to 'sql/connection.cc')
-rw-r--r-- | sql/connection.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/connection.cc b/sql/connection.cc index f94e7ab..7787adf 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -595,7 +595,12 @@ void Connection::Preload() { // work. There could be two prepared statements, one for cache_size=1 one for // cache_size=goal. void Connection::ReleaseCacheMemoryIfNeeded(bool implicit_change_performed) { - DCHECK(is_open()); + // The database could have been closed during a transaction as part of error + // recovery. + if (!db_) { + DLOG_IF(FATAL, !poisoned_) << "Illegal use of connection without a db"; + return; + } // If memory-mapping is not enabled, the page cache helps performance. if (!mmap_enabled_) |