summaryrefslogtreecommitdiffstats
path: root/system/database/DB_query_builder.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-07-22 14:49:08 +0200
committerAndrey Andreev <narf@devilix.net>2016-07-22 14:49:08 +0200
commitd9a4063f87d82836e7d7fe340c5c962e0332e2e5 (patch)
treeaa6288f92d441ac98fbc332f23160e86d344a593 /system/database/DB_query_builder.php
parent71789ce7bb345a9d32bfa9cbf1334876647ea7e1 (diff)
Fix #4713
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r--system/database/DB_query_builder.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 84346a6ed..713bf18f3 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1498,8 +1498,10 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$affected_rows = 0;
for ($i = 0, $total = count($this->qb_set); $i < $total; $i += $batch_size)
{
- $this->query($this->_insert_batch($this->protect_identifiers($table, TRUE, $escape, FALSE), $this->qb_keys, array_slice($this->qb_set, $i, $batch_size)));
- $affected_rows += $this->affected_rows();
+ if ($this->query($this->_insert_batch($this->protect_identifiers($table, TRUE, $escape, FALSE), $this->qb_keys, array_slice($this->qb_set, $i, $batch_size))))
+ {
+ $affected_rows += $this->affected_rows();
+ }
}
$this->_reset_write();
@@ -1913,8 +1915,11 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$affected_rows = 0;
for ($i = 0, $total = count($this->qb_set); $i < $total; $i += $batch_size)
{
- $this->query($this->_update_batch($this->protect_identifiers($table, TRUE, NULL, FALSE), array_slice($this->qb_set, $i, $batch_size), $this->protect_identifiers($index)));
- $affected_rows += $this->affected_rows();
+ if ($this->query($this->_update_batch($this->protect_identifiers($table, TRUE, NULL, FALSE), array_slice($this->qb_set, $i, $batch_size), $this->protect_identifiers($index))))
+ {
+ $affected_rows += $this->affected_rows();
+ }
+
$this->qb_where = array();
}