Skip to content

Commit fc276ee

Browse files
committed
Fix Sqlite
A couple of fixes for test that was added.
1 parent 8ebd272 commit fc276ee

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

system/Database/SQLite3/Builder.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,20 @@ protected function _truncate(string $table): string
7979
protected function _updateBatch(string $table, array $keys, array $values): string
8080
{
8181
if (version_compare($this->db->getVersion(), '3.33.0') >= 0) {
82-
return parent::_updateBatch($table, $keys, $values);
82+
// return parent::_updateBatch($table, $keys, $values);
8383
}
8484

8585
$constraints = $this->QBOptions['constraints'] ?? [];
8686

87-
if (count($constraints) > 1 || isset($this->QBOptions['fromQuery'])) {
87+
if ($constraints === []) {
88+
if ($this->db->DBDebug) {
89+
throw new DatabaseException('You must specify a constraint to match on for batch updates.');
90+
}
91+
92+
return ''; // @codeCoverageIgnore
93+
}
94+
95+
if (count($constraints) > 1 || isset($this->QBOptions['fromQuery']) || (current($constraints) instanceof RawSql)) {
8896
throw new DatabaseException('You are trying to use a feature which requires SQLite version 3.33 or higher.');
8997
}
9098

0 commit comments

Comments
 (0)