Skip to content

[Fix] Disable updating pk value#185

Merged
kTrzcinskii merged 4 commits intomainfrom
fix/prevent-from-updating-pk-value
Jan 11, 2026
Merged

[Fix] Disable updating pk value#185
kTrzcinskii merged 4 commits intomainfrom
fix/prevent-from-updating-pk-value

Conversation

@kTrzcinskii
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR disables updating primary key column values by adding validation in both the analyzer and executor layers to reject UPDATE statements that attempt to modify primary key columns.

Changes:

  • Added PrimaryKeyCannotBeUpdated error variant to the analyzer
  • Implemented primary key update validation in the analyzer's analyze_update_statement method
  • Added redundant runtime validation in the executor's update handler (with associated performance and maintainability concerns)
  • Added comprehensive test coverage for both single and multiple column update scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
planner/src/analyzer.rs Added new error type and validation logic to prevent primary key updates during analysis phase; includes unit tests
executor/src/statement_executor.rs Added redundant runtime validation check for primary key updates in the executor
executor/src/lib.rs Added integration tests to verify primary key update prevention works end-to-end

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kTrzcinskii kTrzcinskii merged commit 108065e into main Jan 11, 2026
1 check passed
@kTrzcinskii kTrzcinskii deleted the fix/prevent-from-updating-pk-value branch January 11, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EXECUTOR] Prevent users from updating value of primary key

3 participants