@@ -2440,9 +2440,14 @@ func processColumnOptions(ctx sessionctx.Context, col *table.Column, options []*
2440
2440
for _ , colName := range findColumnNamesInExpr (opt .Expr ) {
2441
2441
col .Dependences [colName .Name .L ] = struct {}{}
2442
2442
}
2443
+ case ast .ColumnOptionCollate :
2444
+ col .Collate = opt .StrValue
2445
+ case ast .ColumnOptionReference :
2446
+ return errors .Trace (errUnsupportedModifyColumn .GenWithStackByArgs ("with references" ))
2447
+ case ast .ColumnOptionFulltext :
2448
+ return errors .Trace (errUnsupportedModifyColumn .GenWithStackByArgs ("with full text" ))
2443
2449
default :
2444
- // TODO: Support other types.
2445
- return errors .Trace (errUnsupportedModifyColumn .GenWithStackByArgs (opt .Tp ))
2450
+ return errors .Trace (errUnsupportedModifyColumn .GenWithStackByArgs (fmt .Sprintf ("unknown column option type: %d" , opt .Tp )))
2446
2451
}
2447
2452
}
2448
2453
@@ -2524,11 +2529,12 @@ func (d *ddl) getModifiableColumnJob(ctx sessionctx.Context, ident ast.Ident, or
2524
2529
if err != nil {
2525
2530
return nil , errors .Trace (err )
2526
2531
}
2527
- err = modifiable ( & col . FieldType , & newCol . FieldType )
2528
- if err != nil {
2532
+
2533
+ if err = processColumnOptions ( ctx , newCol , specNewColumn . Options ); err != nil {
2529
2534
return nil , errors .Trace (err )
2530
2535
}
2531
- if err = processColumnOptions (ctx , newCol , specNewColumn .Options ); err != nil {
2536
+
2537
+ if err = modifiable (& col .FieldType , & newCol .FieldType ); err != nil {
2532
2538
return nil , errors .Trace (err )
2533
2539
}
2534
2540
0 commit comments