Dolt returns wrong number of affected rows for UPDATE ... JOIN with clientFoundRows=true #7957
Labels
bug
Something isn't working
correctness
We don't return the same result as MySQL
customer issue
good repro
Easily reproducible bugs
When the
clientFoundRows=true
option is set, the database should return the number of found rows during an UPDATE, regardless of whether the rows were actually changed or not. However, with anUPDATE ... JOIN
like the following, Dolt seems to always return the number of changed lines instead:We rely on
clientFoundRows=true
as an optimisation to avoid having to run an extra query to check whether an ID exists when updating items - it allows us to just run an UPDATE, and if the number of found rows differs from the number of items that the user tried to update, we do a rollback and return a 404.Here is a complete example that prints 0 affected rows with Dolt, but 2 with Percona Server 8.3:
The text was updated successfully, but these errors were encountered: