Skip to content

Commit d0c7842

Browse files
committed
add excp for bit in auto_inc create table
1 parent f9d9b7b commit d0c7842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/analyzer/validate_create_table.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,8 @@ func validateAutoIncrementModify(schema sql.Schema, keyedColumns map[string]bool
792792
seen := false
793793
for _, col := range schema {
794794
if col.AutoIncrement {
795-
// Under MySQL 8.4+, AUTO_INCREMENT columns must be integer types.
796-
if !types.IsInteger(col.Type) {
795+
// Under MySQL 8.4+, AUTO_INCREMENT columns must be integer types, but not BIT types.
796+
if !types.IsInteger(col.Type) || types.IsBit(col.Type) {
797797
return sql.ErrInvalidColumnSpecifier.New(col.Name)
798798
}
799799
// keyedColumns == nil means they are trying to add auto_increment column

0 commit comments

Comments
 (0)