Fix Foreign key fuzzer to ignore rows affected #15841
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
After noticing the problem #15826 and running into the issues described in #15779 (comment) and #15779 (comment), the Vitess maintainers have decided not to fix the issue, and instead let the rows affected fields for Vitess and MySQL differ. The reasoning is that all the users of MySQL with foreign keys, should already be accustomed to having the rows affected being different from the total number of row deletions (because MySQL doesn't count the rows deleted via CASCADEs as they happen at the InnoDB level). Moreover, it will take significant code changes and performance penalty to match the MySQL behaviour. We would have to do multiple SELECT queries to find the number of qualifying rows for a DML operation upfront. This however, doesn't feel like the prudent way forward. Instead we are fixing the fuzzer to ignore the rows affected fields while testing and adding a test case for the queries listed in the bug to ensure everything else works.
Related Issue(s)
Checklist
Deployment Notes