Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
We have the following query.
@Query("DELETE FROM table WHERE _id IN (:ids) AND username = :username")
public void delete(List<Long> ids, String username);
Let's say the ids are 5,6, username is "test" and we have rows in the db that would be affected by this. Debuging the dao implementation we see that only one of the ids is in the args, the second one is missing resulting in a faulty query ( the args have "5" and "test"). If the ids is just one (example just 5), the query works.
A workaround i found is to switch the username and ids positions, like so:
@Query("DELETE FROM table WHERE username = :username AND _id IN (:ids)")
public void delete(List<Long> ids, String username);
This way all ids gets passed in the args.