Skip to content

Reject SQL UPDATE with empty SET clause#154

Merged
larsewi merged 1 commit intomasterfrom
reject-empty-update-set
May 7, 2026
Merged

Reject SQL UPDATE with empty SET clause#154
larsewi merged 1 commit intomasterfrom
reject-empty-update-set

Conversation

@larsewi
Copy link
Copy Markdown
Owner

@larsewi larsewi commented May 7, 2026

Summary

  • A malformed ProtoUpdate with no changed columns (empty changed_indices and empty new_value) previously rendered as UPDATE "t" SET WHERE ...; — invalid SQL.
  • format_update now bails when set_parts is empty so corrupt patches surface as a clear error instead of a syntactically broken transaction.
  • Defense in depth: complements Fix swapped parent/child sides in patch consolidation merge #153, which fixes the upstream merge bug that produced such updates.

A malformed update with no changed columns rendered as
`UPDATE "t" SET  WHERE ...;`, which is invalid SQL. The SQL emitter
now bails instead so a corrupt patch surfaces as a clear error
rather than a syntactically broken transaction.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@larsewi larsewi added the bug Bug fix label May 7, 2026
@larsewi larsewi merged commit f1ea91f into master May 7, 2026
6 checks passed
@larsewi larsewi deleted the reject-empty-update-set branch May 7, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant