Skip to content

Copy deleted rows only when OUTPUT or an AFTER DELETE trigger needs them - #2684

Merged
mathiasrw merged 1 commit into
developfrom
fix/delete-clone
Oct 20, 2026
Merged

mathiasrw merged 1 commit into
developfrom
fix/delete-clone

Conversation

@mathiasrw

Copy link
Copy Markdown
Member

Since #2377, DELETE deep-copies every row it deletes when self.output || table.afterdelete is true. table.afterdelete starts as {} (src/23table.js), which is always truthy, so every DELETE … WHERE copied its rows even on a table with no trigger and no OUTPUT. Not measured.

The check is now made once per run: OUTPUT, or at least one AFTER DELETE trigger.

test/test2377-B.js checks that the behaviour stays the same: no trigger, a trigger added after the same DELETE already ran (cached statement), the trigger dropped again, and OUTPUT. These cases also pass without the change; the change only removes the copies.

Found while reviewing #2377.

@mathiasrw mathiasrw added this to the v4.x Focus milestone Oct 20, 2026
@mathiasrw
mathiasrw merged commit 033fd43 into develop Oct 20, 2026
10 checks passed
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.

1 participant