diff --git a/executor/seqtest/seq_executor_test.go b/executor/seqtest/seq_executor_test.go index c2f1a5e57823c..053a1db23ac0f 100644 --- a/executor/seqtest/seq_executor_test.go +++ b/executor/seqtest/seq_executor_test.go @@ -222,11 +222,11 @@ func (s *seqTestSuite) TestShow(c *C) { row = result.Rows()[0] expectedRow = []interface{}{ "t1", "CREATE TABLE `t1` (\n" + - " `c1` tinyint(3) UNSIGNED DEFAULT NULL,\n" + - " `c2` smallint(5) UNSIGNED DEFAULT NULL,\n" + - " `c3` mediumint(8) UNSIGNED DEFAULT NULL,\n" + - " `c4` int(10) UNSIGNED DEFAULT NULL,\n" + - " `c5` bigint(20) UNSIGNED DEFAULT NULL\n" + + " `c1` tinyint(3) unsigned DEFAULT NULL,\n" + + " `c2` smallint(5) unsigned DEFAULT NULL,\n" + + " `c3` mediumint(8) unsigned DEFAULT NULL,\n" + + " `c4` int(10) unsigned DEFAULT NULL,\n" + + " `c5` bigint(20) unsigned DEFAULT NULL\n" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin"} for i, r := range row { c.Check(r, Equals, expectedRow[i]) @@ -557,7 +557,7 @@ func (s *seqTestSuite) TestShow(c *C) { tk.MustQuery(`show create table t`).Check(testutil.RowsWithSep("|", "t CREATE TABLE `t` (\n"+ " `id` int(11) NOT NULL,\n"+ - " `val` tinyint(10) UNSIGNED ZEROFILL DEFAULT NULL,\n"+ + " `val` tinyint(10) unsigned zerofill DEFAULT NULL,\n"+ " PRIMARY KEY (`id`)\n"+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) diff --git a/table/column.go b/table/column.go index 9f893aefa4e9b..a63cbcdaaa4d1 100644 --- a/table/column.go +++ b/table/column.go @@ -222,10 +222,10 @@ const defaultPrivileges = "select,insert,update,references" func (c *Column) GetTypeDesc() string { desc := c.FieldType.CompactStr() if mysql.HasUnsignedFlag(c.Flag) && c.Tp != mysql.TypeBit && c.Tp != mysql.TypeYear { - desc += " UNSIGNED" + desc += " unsigned" } if mysql.HasZerofillFlag(c.Flag) && c.Tp != mysql.TypeYear { - desc += " ZEROFILL" + desc += " zerofill" } return desc } diff --git a/table/column_test.go b/table/column_test.go index e197b58747834..ab48e27c2edb8 100644 --- a/table/column_test.go +++ b/table/column_test.go @@ -43,7 +43,7 @@ func (t *testTableSuite) TestString(c *C) { col.Collate = mysql.DefaultCollationName col.Flag |= mysql.ZerofillFlag | mysql.UnsignedFlag | mysql.BinaryFlag | mysql.AutoIncrementFlag | mysql.NotNullFlag - c.Assert(col.GetTypeDesc(), Equals, "tinyint(2) UNSIGNED ZEROFILL") + c.Assert(col.GetTypeDesc(), Equals, "tinyint(2) unsigned zerofill") col.ToInfo() tbInfo := &model.TableInfo{} c.Assert(col.IsPKHandleColumn(tbInfo), Equals, false)