Uh oh!
There was an error while loading. Please reload this page.
refactor: Clean up mysqli transactions - #9888
Conversation
Hi there, kamil-tekiela! 👋 Thank you for sending this PR! We expect the following in all Pull Requests (PRs).
Important We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works. If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md Sincerely, the mergeable bot 🤖 |
michalsn
left a comment
There was a problem hiding this comment.
I had to read up on it, and it looks like you're right. Thanks.
Uh oh!
There was an error while loading. Please reload this page.
Description
Turning off autocommit and starting a transaction makes very little sense. Unless you expect users to issue manual commit statements, the begin transaction is sufficient. Comparing it to the other Connection classes, only the mysqli one does that, which can be considered a bug. If you would like to allow the user to issue manual commit statements then keep only autocommit and remove begin and commit. Additionally, these functions always return true (because of exception mode) and so the if statements and return statements are not meaningful.
Checklist: