aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite3.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 2000acb251..0508500c52 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -102,7 +102,7 @@ class sqlite3 extends \phpbb\db\driver\driver
break;
case 'rollback':
- return $this->dbo->exec('ROLLBACK');
+ return @$this->dbo->exec('ROLLBACK');
break;
}
@@ -134,6 +134,11 @@ class sqlite3 extends \phpbb\db\driver\driver
if ($this->query_result === false)
{
+ if ($this->transaction === true && strpos($query, 'INSERT') === 0)
+ {
+ $query = preg_replace('/^INSERT INTO/', 'INSERT OR ROLLBACK INTO', $query);
+ }
+
if (($this->query_result = @$this->dbo->query($query)) === false)
{
// Try to recover a lost database connection
@@ -225,6 +230,7 @@ class sqlite3 extends \phpbb\db\driver\driver
if ($query_id === false)
{
+ /** @var \SQLite3Result $query_id */
$query_id = $this->query_result;
}
@@ -233,7 +239,7 @@ class sqlite3 extends \phpbb\db\driver\driver
return $cache->sql_fetchrow($query_id);
}
- return is_object($query_id) ? $query_id->fetchArray(SQLITE3_ASSOC) : false;
+ return is_object($query_id) ? @$query_id->fetchArray(SQLITE3_ASSOC) : false;
}
/**