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
{{ message }}
Repository navigation
[Bug]: ALTER SET DEFAULT silently succeeds on AUTO_INCREMENT and generated columns #26844
ALTER TABLE ... ALTER COLUMN ... SET DEFAULT reports success for AUTO_INCREMENT and generated columns but silently leaves the schema unchanged. Unsupported or invalid ALTER requests must be rejected rather than acknowledged as successful no-ops.
Reproduced 3/3 for both column kinds on current main commit 45a917d7f8f7b2f32c28ca0a734318875722a00e.
Reproduction
createdatabaserepro_alter_default;
use repro_alter_default;
createtableai(id bigint auto_increment, v int);
altertable ai alter column id set default 9;
show create table ai;
createtablegen(id int, a int, g intas(a+1) stored);
altertable gen alter column g set default 9;
show create table gen;
the effective AUTO_INCREMENT/generated-column behavior is unchanged.
Running each statement on three independently created tables produces the same result. A normal-column control (alter column v set default 9) succeeds and exposes default 9 immediately.
Expected result
Because a user default cannot be applied to an AUTO_INCREMENT or generated column, the ALTER statement must return an explicit error and leave the table unchanged. It must not report successful DDL while discarding the requested action.
Analysis
AlterColumn builds a new default and writes it into the copied ColDef without rejecting AUTO_INCREMENT or generated columns. The later ALTER-copy/table-definition path does not retain that invalid default, so execution commits a schema equivalent to the original while returning success.
The MOTR files were added to prevent successful no-op DDL from returning for unsupported defaults. They preserve valid
normal-column behavior and verify rejection plus schema immutability for AUTO_INCREMENT, stored generated, and virtual
generated columns. No MatrixOne service source code was modified.
Final conclusion
#26844 is fixed on current main: unsupported SET DEFAULT operations now fail explicitly instead of succeeding
without applying the requested schema change.
Suggested resolution: push and merge the MOTR regression PR, then close #26844.
Activity
fix(plan): reject invalid ALTER COLUMN defaults (#26880)
slyunnn commentedon Aug 11, 2026
Regression and extended verification for #26844 (2026-08-11)
Verification environment
d01c85974f9540f8baa2e768ca86fea952941fe2fix(hashjoin): broadcast const vectors in spill paths (#26938)df49b097935ccd650d9f30016d5219228e053c5efix(plan): reject invalid ALTER COLUMN defaults (#26880)test/issue-26844-alter-set-default8b6ae6d08d757ec01ff6d4d672ea3a6e6480f0c4Regression verification
Reproduced the original invalid
ALTER COLUMN ... SET DEFAULTrequests:1067.20301.20301.All rejected operations left
information_schema.columns.column_defaultasNULL; no invalid default was silentlyaccepted.
Extended verification
Happy path:
SET DEFAULT 9.9.DROP DEFAULTsucceeds; a later omitted value becomesNULL.Boundary coverage:
Unhappy path:
MOTR regression
suites/14_issue_regression/t/issue_26844_alter_set_default.testsuites/14_issue_regression/r/issue_26844_alter_set_default.resultTest-file changes
The MOTR files were added to prevent successful no-op DDL from returning for unsupported defaults. They preserve valid
normal-column behavior and verify rejection plus schema immutability for AUTO_INCREMENT, stored generated, and virtual
generated columns. No MatrixOne service source code was modified.
Final conclusion
#26844 is fixed on current
main: unsupportedSET DEFAULToperations now fail explicitly instead of succeedingwithout applying the requested schema change.
Suggested resolution: push and merge the MOTR regression PR, then close #26844.
fix(plan): reject invalid ALTER COLUMN defaults (matrixorigin#26880)
fix(plan): reject invalid ALTER COLUMN defaults (matrixorigin#26880)
fix(plan): reject invalid ALTER COLUMN defaults (matrixorigin#26880)