From ef7a9df3a474a2e28616f7b940b16ca80f91e4ae Mon Sep 17 00:00:00 2001 From: siddontang Date: Tue, 29 Sep 2015 09:23:19 +0800 Subject: [PATCH] plans: handle NOT NULL flag --- plan/plans/show.go | 3 +++ 1 file changed, 3 insertions(+) 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")