@@ -45,7 +45,7 @@ func (c *cc) convertAlterTableStmt(n *pcast.AlterTableStmt) ast.Node {
45
45
name := def .Name .String ()
46
46
columnDef := ast.ColumnDef {
47
47
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 ())},
49
49
IsNotNull : isNotNull (def ),
50
50
}
51
51
if def .Tp .GetFlen () >= 0 {
@@ -78,7 +78,7 @@ func (c *cc) convertAlterTableStmt(n *pcast.AlterTableStmt) ast.Node {
78
78
name := def .Name .String ()
79
79
columnDef := ast.ColumnDef {
80
80
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 ())},
82
82
IsNotNull : isNotNull (def ),
83
83
}
84
84
if def .Tp .GetFlen () >= 0 {
@@ -97,7 +97,7 @@ func (c *cc) convertAlterTableStmt(n *pcast.AlterTableStmt) ast.Node {
97
97
name := def .Name .String ()
98
98
columnDef := ast.ColumnDef {
99
99
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 ())},
101
101
IsNotNull : isNotNull (def ),
102
102
}
103
103
if def .Tp .GetFlen () >= 0 {
@@ -266,7 +266,7 @@ func (c *cc) convertCreateTableStmt(n *pcast.CreateTableStmt) ast.Node {
266
266
}
267
267
columnDef := ast.ColumnDef {
268
268
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 ())},
270
270
IsNotNull : isNotNull (def ),
271
271
Comment : comment ,
272
272
Vals : vals ,
0 commit comments