[branch-2.1] Picks "[opt](autoinc) Remove some restrictions on schema change on table that has auto-increment column #40280" (#41096)
picks https://github.com/apache/doris/pull/40280
This commit is contained in:
@ -718,12 +718,6 @@ public class SchemaChangeHandler extends AlterHandler {
|
||||
} // end for handling other indices
|
||||
|
||||
if (typeChanged && !lightSchemaChange) {
|
||||
Optional<Column> autoIncCol = olapTable.getBaseSchema(true).stream()
|
||||
.filter(col -> col.isAutoInc()).findFirst();
|
||||
if (autoIncCol.isPresent()) {
|
||||
throw new DdlException("Can not modify column " + modColumn.getName() + " becasue table "
|
||||
+ olapTable.getName() + " has auto-increment column " + autoIncCol.get().getName());
|
||||
}
|
||||
/*
|
||||
* In new alter table process (AlterJobV2), any modified columns are treated as new columns.
|
||||
* But the modified columns' name does not changed. So in order to distinguish this, we will add
|
||||
|
||||
Reference in New Issue
Block a user