diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index ea3488d9e9aa..af92aa328bf8 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -2214,6 +2214,7 @@ public function updateBatch(array $set = null, string $index = null, int $batchS // Batch this baby $affected_rows = 0; $savedSQL = []; + $savedQBWhere = $this->QBWhere; for ($i = 0, $total = count($this->QBSet); $i < $total; $i += $batchSize) { $sql = $this->_updateBatch($table, array_slice($this->QBSet, $i, $batchSize), $this->db->protectIdentifiers($index) @@ -2229,7 +2230,7 @@ public function updateBatch(array $set = null, string $index = null, int $batchS $affected_rows += $this->db->affectedRows(); } - $this->QBWhere = []; + $this->QBWhere = $savedQBWhere; } $this->resetWrite();