aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php14
-rw-r--r--phpBB/phpbb/search/fulltext_native.php10
2 files changed, 19 insertions, 5 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'))
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
index 3a74955a18..5fc276170d 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -1478,10 +1478,7 @@ class fulltext_native extends \phpbb\search\base
$this->db->sql_return_on_error(false);
}
unset($new_words, $sql_ary);
- }
- else
- {
- $this->db->sql_transaction('begin');
+ $this->db->sql_transaction('commit');
}
// now update the search match table, remove links to removed words and add links to new words
@@ -1513,6 +1510,11 @@ class fulltext_native extends \phpbb\search\base
}
}
+ if (!count($unique_add_words))
+ {
+ $this->db->sql_transaction('begin');
+ }
+
$this->db->sql_return_on_error(true);
foreach ($words['add'] as $word_in => $word_ary)
{