diff --git a/plan/plans/show.go b/plan/plans/show.go index e648a51433..c4dde0e615 100644 --- a/plan/plans/show.go +++ b/plan/plans/show.go @@ -409,6 +409,9 @@ func (s *ShowPlan) fetchShowCreateTable(ctx context.Context) error { if mysql.HasAutoIncrementFlag(col.Flag) { buf.WriteString(" NOT NULL AUTO_INCREMENT") } else { + if mysql.HasNotNullFlag(col.Flag) { + buf.WriteString(" NOT NULL") + } switch col.DefaultValue { case nil: buf.WriteString(" DEFAULT NULL")