From 97d4a15aa22ea5abd218f4de6c4237d95d35e938 Mon Sep 17 00:00:00 2001 From: Andreas Piening Date: Thu, 17 Jun 2010 22:15:02 +0000 Subject: [PATCH] MINOR: fixed error msg retrival --- code/SQLite3Database.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/SQLite3Database.php b/code/SQLite3Database.php index f6a335e..4fd99ba 100644 --- a/code/SQLite3Database.php +++ b/code/SQLite3Database.php @@ -362,7 +362,13 @@ class SQLite3Database extends SS_Database { 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', E_USER_NOTICE); - if(preg_match('/authoriz/', $msg = $this->dbConn->lastErrorMsg())) { + if($this instanceof SQLitePDODatabase) { + $msg = $this->dbConn->errorInfo(); + $msg = $msg[2]; + } else { + $msg = $this->dbConn->lastErrorMsg(); + } + if(preg_match('/authoriz/', $msg)) { $this->alterationMessage('VACUUM | ' . $msg, "error"); } else { $this->alterationMessage("VACUUMing", "repaired");