Skip to content

Commit

Permalink
fix: 修复非空字段insert时对自增列的处理 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Nov 18, 2019
1 parent a13a5b9 commit a8b087a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion session/session_inception.go
Original file line number Diff line number Diff line change
Expand Up @@ -4993,7 +4993,7 @@ func (s *session) checkInsert(node *ast.InsertStmt, sql string) {
for _, field := range table.Fields {
if strings.EqualFold(field.Field, c.Name.O) && !field.IsDeleted {
found = true
if field.Null == "NO" {
if field.Null == "NO" && !strings.Contains(field.Extra, "auto_increment") {
columnsCannotNull[c.Name.L] = true
}
break
Expand Down

0 comments on commit a8b087a

Please sign in to comment.