plans: handle NOT NULL flag

This commit is contained in:
siddontang
2015-09-29 09:23:19 +08:00
parent 4d0a853404
commit ef7a9df3a4

View File

@ -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")