aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite3.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-10-22 11:27:03 +0200
committerMate Bartus <mate.bartus@gmail.com>2015-10-23 11:46:03 +0200
commite0d06ee83ebf9ae72ef9746385155168fb083fa9 (patch)
tree097cd28be8672432998b7a7bd4dd4f7d88825a70 /phpBB/phpbb/db/driver/sqlite3.php
parent597297b169e2ae14684ad1f40c8e083be22b241d (diff)
downloadforums-e0d06ee83ebf9ae72ef9746385155168fb083fa9.tar
forums-e0d06ee83ebf9ae72ef9746385155168fb083fa9.tar.gz
forums-e0d06ee83ebf9ae72ef9746385155168fb083fa9.tar.bz2
forums-e0d06ee83ebf9ae72ef9746385155168fb083fa9.tar.xz
forums-e0d06ee83ebf9ae72ef9746385155168fb083fa9.zip
[ticket/14044] Fix Sqlite error in tests
PHPBB3-14044
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index b7f6e60337..2000acb251 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -136,7 +136,19 @@ class sqlite3 extends \phpbb\db\driver\driver
{
if (($this->query_result = @$this->dbo->query($query)) === false)
{
- $this->sql_error($query);
+ // Try to recover a lost database connection
+ if ($this->dbo && !@$this->dbo->lastErrorMsg())
+ {
+ if ($this->sql_connect($this->server, $this->user, '', $this->dbname))
+ {
+ $this->query_result = @$this->dbo->query($query);
+ }
+ }
+
+ if ($this->query_result === false)
+ {
+ $this->sql_error($query);
+ }
}
if (defined('DEBUG'))