mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[feature/sqlite3] Add support for SQLite 3
Minimum version requirement is 3.6.15 as that's what ships with PHP 5.3.0 when support for SQLite 3 was added. PHPBB3-9728
This commit is contained in:
committed by
Joas Schilling
parent
d52c2d1b5c
commit
b39b0369aa
@@ -768,6 +768,7 @@ class fulltext_native extends \phpbb\search\base
|
||||
break;
|
||||
|
||||
case 'sqlite':
|
||||
case 'sqlite3':
|
||||
$sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id';
|
||||
$sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results
|
||||
FROM (' . $this->db->sql_build_query('SELECT', $sql_array_count) . ')';
|
||||
@@ -997,7 +998,7 @@ class fulltext_native extends \phpbb\search\base
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->db->sql_layer == 'sqlite')
|
||||
if ($this->db->sql_layer == 'sqlite' || $this->db->sql_layer == 'sqlite3')
|
||||
{
|
||||
$sql = 'SELECT COUNT(topic_id) as total_results
|
||||
FROM (SELECT DISTINCT t.topic_id';
|
||||
@@ -1014,7 +1015,7 @@ class fulltext_native extends \phpbb\search\base
|
||||
$post_visibility
|
||||
$sql_fora
|
||||
AND t.topic_id = p.topic_id
|
||||
$sql_time" . (($this->db->sql_layer == 'sqlite') ? ')' : '');
|
||||
$sql_time" . (($this->db->sql_layer == 'sqlite' || $this->db->sql_layer == 'sqlite3') ? ')' : '');
|
||||
}
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
@@ -1481,6 +1482,7 @@ class fulltext_native extends \phpbb\search\base
|
||||
switch ($this->db->sql_layer)
|
||||
{
|
||||
case 'sqlite':
|
||||
case 'sqlite3':
|
||||
case 'firebird':
|
||||
$this->db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE);
|
||||
$this->db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE);
|
||||
|
Reference in New Issue
Block a user