-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Avoid negative values from Result::rowCount()
#5915
Conversation
74983a0
to
68c85d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR: I am against merging this PR in it's current form. A negative number of affected rows is treated as if the SQL statement itself was unsuccessful, which is not necessarily the case.
5464946
to
28ed740
Compare
I agree with your concern, that's why I opened #5917 in order to avoid unwanted effects related to the expected behavior. Any help to reproduce the -1 result is greatly appreciated 🙏 |
8cf7c68
to
7e1a5be
Compare
32b4a26
to
71e0a46
Compare
71e0a46
to
d3a933d
Compare
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
This pull request was closed due to inactivity. |
Summary
To me, returning
-1
from a method that should count affected records is counter-intuitive.IMO, the errors must be reported with a proper exception mechanism, not using arbitrary values (negative integers in this case) in methods that are intended to return something else. This way, we can have confident results.
Related to #5905 (comment).
Depends on #5917.
To-Do
Mysqli\Result
#5917.