You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow DEFAULT keyword in UPDATE for generated columns (issue #9438)
This commit fixes issue #9438 where updating a generated column with
the DEFAULT keyword was incorrectly rejected. The previous validation
logic prevented any UPDATE of generated columns without checking if
the value being assigned was DEFAULT.
Changes:
- Modified validation in dml.go to allow DEFAULT expressions for generated columns
- For generated columns, DEFAULT now correctly uses the generated expression
- Added comprehensive test case covering various UPDATE scenarios
- Maintains existing validation that rejects non-DEFAULT values for generated columns
MySQL behavior:
- `UPDATE t SET generated_col = DEFAULT` should succeed (now works)
- `UPDATE t SET generated_col = value` should fail (still works)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments