Skip to content

Fix MySQL and MariaDB mail cleanup - #540

Open
amanjain wants to merge 1 commit into
ui:masterfrom
amanjain:fix/mysql-mail-cleanup
Open

amanjain wants to merge 1 commit into
ui:masterfrom
amanjain:fix/mysql-mail-cleanup

Conversation

@amanjain

Copy link
Copy Markdown
Contributor

Materialize each batch of email IDs before deletion to avoid the unsupported LIMIT in an IN subquery on MySQL/MariaDB.

Includes a regression test and changelog entry.

Fixes #456. Split from #539 as requested.

Validation: full test suites passed on Django 4.2.30 and 6.1.2; formatting checks passed.

@selwin ready for review.
@autoantwort @presidento could you verify this against your reported case?

Materialize the bounded email ID batch before deleting it, avoiding
MySQL and MariaDB's unsupported LIMIT-in-IN-subquery query. Keep the
existing batching and attachment cleanup behavior.

Add a regression check for the cleanup query and a changelog entry.
Fixes ui#456.

Validation: full suites on Django 4.2.30 and 6.1.2; formatting check.
@presidento

presidento commented Oct 14, 2026 via email

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MySQLdb.NotSupportedError

2 participants