Skip to content

Commit c18c70e

Browse files
committed
refactor: do not use $this->binds when insertBatch()
To reduce memory consumption.
1 parent 0f3088c commit c18c70e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

system/Database/BaseBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ public function insertBatch(?array $set = null, ?bool $escape = null, int $batch
16251625
if ($this->testMode) {
16261626
$savedSQL[] = $sql;
16271627
} else {
1628-
$this->db->query($sql, $this->binds, false);
1628+
$this->db->query($sql, null, false);
16291629
$affectedRows += $this->db->affectedRows();
16301630
}
16311631
}
@@ -1679,7 +1679,7 @@ public function setInsertBatch($key, string $value = '', ?bool $escape = null)
16791679
$clean = [];
16801680

16811681
foreach ($row as $k => $rowValue) {
1682-
$clean[] = ':' . $this->setBind($k, $rowValue, $escape) . ':';
1682+
$clean[] = $escape ? $this->db->escape($rowValue) : $rowValue;
16831683
}
16841684

16851685
$row = $clean;

0 commit comments

Comments
 (0)