diff --git a/system/Database/Postgre/Builder.php b/system/Database/Postgre/Builder.php index 1d80f687568c..b0a94670ff18 100644 --- a/system/Database/Postgre/Builder.php +++ b/system/Database/Postgre/Builder.php @@ -96,7 +96,13 @@ public function increment(string $column, int $value = 1) $sql = $this->_update($this->QBFrom[0], [$column => "to_number({$column}, '9999999') + {$value}"]); - return $this->db->query($sql, $this->binds, false); + if (! $this->testMode) { + $this->resetWrite(); + + return $this->db->query($sql, $this->binds, false); + } + + return true; } /** @@ -112,7 +118,13 @@ public function decrement(string $column, int $value = 1) $sql = $this->_update($this->QBFrom[0], [$column => "to_number({$column}, '9999999') - {$value}"]); - return $this->db->query($sql, $this->binds, false); + if (! $this->testMode) { + $this->resetWrite(); + + return $this->db->query($sql, $this->binds, false); + } + + return true; } /** diff --git a/system/Database/SQLSRV/Builder.php b/system/Database/SQLSRV/Builder.php index a5bf829a6b74..8d0e0b419620 100755 --- a/system/Database/SQLSRV/Builder.php +++ b/system/Database/SQLSRV/Builder.php @@ -255,7 +255,13 @@ public function increment(string $column, int $value = 1) $sql = $this->_update($this->QBFrom[0], $values); - return $this->db->query($sql, $this->binds, false); + if (! $this->testMode) { + $this->resetWrite(); + + return $this->db->query($sql, $this->binds, false); + } + + return true; } /** @@ -275,7 +281,13 @@ public function decrement(string $column, int $value = 1) $sql = $this->_update($this->QBFrom[0], $values); - return $this->db->query($sql, $this->binds, false); + if (! $this->testMode) { + $this->resetWrite(); + + return $this->db->query($sql, $this->binds, false); + } + + return true; } /**