From 7ad5ac08084ab218346331ef04e227d1426dc117 Mon Sep 17 00:00:00 2001 From: Andreas Piening Date: Wed, 16 Jun 2010 22:27:33 +0000 Subject: [PATCH] MINOR: catch VACUUM authorization error --- code/SQLite3Database.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/SQLite3Database.php b/code/SQLite3Database.php index 7ba7815..f6a335e 100644 --- a/code/SQLite3Database.php +++ b/code/SQLite3Database.php @@ -361,8 +361,12 @@ class SQLite3Database extends SS_Database { $this->alterationMessage("Checking database integrity","repaired"); if($msgs = $this->query('PRAGMA integrity_check')) foreach($msgs as $msg) if($msg['integrity_check'] != 'ok') { Debug::show($msg['integrity_check']); $ok = false; } if(self::$vacuum) { - $this->query('VACUUM'); - $this->alterationMessage("VACUUMing","repaired"); + $this->query('VACUUM', E_USER_NOTICE); + if(preg_match('/authoriz/', $msg = $this->dbConn->lastErrorMsg())) { + $this->alterationMessage('VACUUM | ' . $msg, "error"); + } else { + $this->alterationMessage("VACUUMing", "repaired"); + } } self::$checked_and_repaired = true; }