Closed rastafan closed 2 weeks ago
@rastafan which platform?
tried only on web platform, still to test on android/ios
@rastafan you right there is no reason to sent an error if changes is equal to 0. i will fix it in the next release
Alright, thank you very much!!
@rastafan fixed in v5.7.3-3.
Hi,
i noticed that executing statements such as DELETE or UPDATE which results in no rows changed, causes the plugin to throw an exception.
As an example, this is the case of DELETE operations on empty tables, or using conditions that results in no rows deleted.
This happens when using
executeTransaction
and passing parameters along with the statement:this causes the plugin to use the run method internally. The returned number of changes is 0, which seems right, but 0 is treated as an error condition and an exception is thrown. This behavior is different from the "execute" part of this code, which is uses when no values are passed, and does not treat the "0 changes" condition as an error state.
The piece of internal code i'm referring to is this one: LINK
I would make a PR for this, but i'm not able to understand if there is a condition where it returns changes=0 upon some sort of error.
If anyone can help me test it (or can test it in my place) please let me know, so i can make a PR for this.
Thank you very much.