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.
feat: Address MySQL limitations in delete operation
Changes Made:
MySQL does not support LIMIT in subqueries within IN clauses:
LIMIT
inside anIN
clause for deletion operations, which is not supported by MySQL.MySQL does not support DELETE operations where the filtering condition queries the same table:
Summary:
To ensure compatibility with MySQL, the code now performs deletions in two steps:
This change avoids both the limitation of using
LIMIT
within subqueries inIN
clauses and the issue of referencing the same table in the DELETE statement's WHERE clause.Please review and let me know if there are any further adjustments needed.