From 016d848a87aa78cd1bac1072518eeef367e4115b Mon Sep 17 00:00:00 2001 From: Andreas Piening Date: Thu, 20 May 2010 21:43:00 +0000 Subject: [PATCH] MINOR: made the execution of vacuuming configurable, cause its causing errors in some envs --- code/SQLite3Database.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/SQLite3Database.php b/code/SQLite3Database.php index 86389c1..19ce40f 100644 --- a/code/SQLite3Database.php +++ b/code/SQLite3Database.php @@ -44,6 +44,8 @@ class SQLite3Database extends SS_Database { public static $default_pragma = array(); + public static $vacuum = true; + /** * Connect to a SQLite3 database. * @param array $parameters An map of parameters, which should include: @@ -358,8 +360,10 @@ class SQLite3Database extends SS_Database { $this->alterationMessage("SQLite$class Version " . $this->query("SELECT sqlite_version()")->value(),"repaired"); $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; } - $this->query('VACUUM'); - $this->alterationMessage("VACUUMing","repaired"); + if(self::$vacuum) { + $this->query('VACUUM'); + $this->alterationMessage("VACUUMing","repaired"); + } self::$checked_and_repaired = true; }