From 738644a0069181187dfed2fbd9ce0fb344b8ffb9 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 11 Jun 2018 03:56:19 +0000 Subject: [PATCH] Quit if database connection was lost during "e" --- include/dba.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/dba.php b/include/dba.php index b21b01b6db..c0617af8e8 100644 --- a/include/dba.php +++ b/include/dba.php @@ -598,6 +598,13 @@ class dba { logger('DB Error '.self::$errorno.': '.self::$error."\n". System::callstack(8)."\n".self::replaceParameters($sql, $params)); + // On a lost connection we simply quit. + // A reconnect like in self::p could be dangerous with modifications + if ($errorno == 2006) { + logger('Giving up because of database error '.$errorno.': '.$error); + exit(1); + } + self::$error = $error; self::$errorno = $errorno; }