dialect/sql/schema: add mysql binary support for native uuid handling in 8.0+ (#1085)

This commit is contained in:
Noah-Jerome Lotzer
2021-01-06 13:47:41 +01:00
committed by GitHub
parent b67cc9b135
commit d384b3ecc4
2 changed files with 34 additions and 1 deletions

View File

@@ -405,6 +405,9 @@ func (d *MySQL) scanColumn(c *Column, rows *sql.Rows) error {
case "tinyblob":
c.Size = math.MaxUint8
c.Type = field.TypeBytes
case "binary":
c.Size = size
c.Type = field.TypeBytes
case "blob":
c.Size = math.MaxUint16
c.Type = field.TypeBytes
@@ -604,7 +607,7 @@ func parseColumn(typ string) (parts []string, size int64, unsigned bool, err err
case len(parts) == 2: // int(10)
size, err = strconv.ParseInt(parts[1], 10, 0)
}
case "varbinary", "varchar", "char":
case "varbinary", "varchar", "char", "binary":
size, err = strconv.ParseInt(parts[1], 10, 64)
}
if err != nil {