Skip to content

Commit 8b9bd88

Browse files
committed
Fix the bug
1 parent aa64c6b commit 8b9bd88

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎system/Database/SQLSRV/Builder.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function decrement(string $column, int $value = 1)
269269
if ($this->castTextToInt) {
270270
$values = [$column => "CONVERT(VARCHAR(MAX),CONVERT(INT,CONVERT(VARCHAR(MAX), {$column})) - {$value})"];
271271
} else {
272-
$values = [$column => "{$column} + {$value}"];
272+
$values = [$column => "{$column} - {$value}"];
273273
}
274274

275275
$sql = $this->_update($this->QBFrom[0], $values);

‎user_guide_src/source/changelogs/v4.7.3.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Bugs Fixed
4343
- **Kint:** Fixed a bug where stale Content Security Policy nonces were reused in worker mode, causing browser CSP violations for Debug Toolbar assets.
4444
- **Time:** Fixed a bug where ``Time::createFromTimestamp()`` could fail for microsecond timestamps when ``LC_NUMERIC`` used a comma decimal separator.
4545
- **Validation:** Fixed a bug where ``Validation::getValidated()`` dropped fields whose validated value was explicitly ``null``.
46+
- **SQLSRV Database Driver:** Fixed a bug where the SQLSRV driver's decrement method was adding instead of subtracting the decrement value when ``$castTextToInt`` was false.
4647

4748
See the repo's
4849
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_

0 commit comments

Comments
 (0)