@@ -45,7 +45,7 @@ func (c *cc) convertAlterTableStmt(n *pcast.AlterTableStmt) ast.Node {
4545 name := def .Name .String ()
4646 columnDef := ast.ColumnDef {
4747 Colname : def .Name .String (),
48- TypeName : & ast.TypeName {Name : types .TypeStr (def .Tp .GetType ())},
48+ TypeName : & ast.TypeName {Name : types .TypeToStr (def .Tp .GetType (), def . Tp . GetCharset ())},
4949 IsNotNull : isNotNull (def ),
5050 }
5151 if def .Tp .GetFlen () >= 0 {
@@ -78,7 +78,7 @@ func (c *cc) convertAlterTableStmt(n *pcast.AlterTableStmt) ast.Node {
7878 name := def .Name .String ()
7979 columnDef := ast.ColumnDef {
8080 Colname : def .Name .String (),
81- TypeName : & ast.TypeName {Name : types .TypeStr (def .Tp .GetType ())},
81+ TypeName : & ast.TypeName {Name : types .TypeToStr (def .Tp .GetType (), def . Tp . GetCharset ())},
8282 IsNotNull : isNotNull (def ),
8383 }
8484 if def .Tp .GetFlen () >= 0 {
@@ -97,7 +97,7 @@ func (c *cc) convertAlterTableStmt(n *pcast.AlterTableStmt) ast.Node {
9797 name := def .Name .String ()
9898 columnDef := ast.ColumnDef {
9999 Colname : def .Name .String (),
100- TypeName : & ast.TypeName {Name : types .TypeStr (def .Tp .GetType ())},
100+ TypeName : & ast.TypeName {Name : types .TypeToStr (def .Tp .GetType (), def . Tp . GetCharset ())},
101101 IsNotNull : isNotNull (def ),
102102 }
103103 if def .Tp .GetFlen () >= 0 {
@@ -266,7 +266,7 @@ func (c *cc) convertCreateTableStmt(n *pcast.CreateTableStmt) ast.Node {
266266 }
267267 columnDef := ast.ColumnDef {
268268 Colname : def .Name .String (),
269- TypeName : & ast.TypeName {Name : types .TypeStr (def .Tp .GetType ())},
269+ TypeName : & ast.TypeName {Name : types .TypeToStr (def .Tp .GetType (), def . Tp . GetCharset ())},
270270 IsNotNull : isNotNull (def ),
271271 Comment : comment ,
272272 Vals : vals ,
0 commit comments