Skip to content

Commit

Permalink
Merge pull request #2252 from searchy2/ray-batchupdatefix
Browse files Browse the repository at this point in the history
QUICKFIX Batch Update Where Reset
  • Loading branch information
MGatner authored Sep 27, 2019
2 parents 4a3011b + 329f295 commit fd1e93b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,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)
Expand All @@ -2503,7 +2504,7 @@ public function updateBatch(array $set = null, string $index = null, int $batchS
$affected_rows += $this->db->affectedRows();
}

$this->QBWhere = [];
$this->QBWhere = $savedQBWhere;
}

$this->resetWrite();
Expand Down

0 comments on commit fd1e93b

Please sign in to comment.