Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: BaseBuilder increment/decrement do not reset state after a query. #6145

Closed
iRedds opened this issue Jun 17, 2022 · 1 comment · Fixed by #6146
Closed

Bug: BaseBuilder increment/decrement do not reset state after a query. #6145

iRedds opened this issue Jun 17, 2022 · 1 comment · Fixed by #6146
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@iRedds
Copy link
Collaborator

iRedds commented Jun 17, 2022

PHP Version

7.4

CodeIgniter4 Version

4.2.1

CodeIgniter4 Installation Method

Git

Which operating systems have you tested for this bug?

Windows

Which server did you use?

cli-server (PHP built-in webserver)

Database

No response

What happened?

If you call several increment/decrement in a row, then the state is not reset.

Steps to Reproduce

$db = db_connect()->table('table');

$db->where('id', 1)->increment('value'); // UPDATE `table` SET `value` = `value` + 1 WHERE `id` = 1;
$db->where('id', 2)->increment('value'); // UPDATE `table` SET `value` = `value` + 1 WHERE `id` = 1 AND `id` = 2;
@iRedds iRedds added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 17, 2022
@kenjis
Copy link
Member

kenjis commented Jun 19, 2022

Fixed by #6146

@kenjis kenjis closed this as completed Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants