You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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._db.executeTransaction([
{
statement: 'DELETE FROM some_table WHERE some_column = ?',
values: [2]
},
{
statement: 'DELETE FROM some_other_table WHERE some_other_column = ?',
values: [3]
}
])
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: