Skip to content

Commit

Permalink
fix 1234
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq committed Sep 11, 2024
1 parent a7dca55 commit cf90e44
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ func (c CreateTableResult) GetTableCharset() (engine string) {
// GetAllColCharsets get columns define charset
func (c CreateTableResult) GetAllColCharsets() (charsets []string) {
for _, colDef := range c.CreateDefinitions.ColDefs {
if lo.IsNotEmpty(colDef.CharacterSet) {
// Mysql会对MYSQL_TYPE_TIME,MYSQL_TYPE_TIMESTAMP,MYSQL_TYPE_DATETIME这三种类型的字段默认设置字符集为latin1
if lo.IsNotEmpty(colDef.CharacterSet) && !lo.Contains([]string{"timestamp", "time", "datetime"}, colDef.DataType) {
charsets = append(charsets, colDef.CharacterSet)
}
}
Expand Down

0 comments on commit cf90e44

Please sign in to comment.