You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What version of Go and system type/arch are you using?
go1.18.1, linux/amd64
2. What version of GoFrame are you using?
v2.5.3
3. Can this issue be re-produced with the latest release?
yes
4. What did you do?
// Uid is not allowed to be null in MySQLtypeUserstruct {
g.Meta`orm:"table:user, do:true"`Uidinterface{} // User IDNameinterface{} // User Nickname
}
// Construct a list that does not comply with MySQL constraints// The first user is incorrect data, and the second user is correctlist:= []*User{
{
Uid: nil,
Name: "john",
},
{
Uid: 1,
Name: "john",
},
}
err:=g.Model("user").Data(list).Batch(10).Insert()
iferr!=nil {
painc(err)
}
5. What did you expect to see?
panic err
6. What did you see instead?
mysql has no data, and the console also prints an error, but in fact err is nil
KeyListMap.Size() > 1, and c.DoInsert will be executed twice, and when the first iteration failed, return &sqlResult, nil will set err to nil, causing err not to return
8. How to solve it
return &sqlResult, err
The text was updated successfully, but these errors were encountered:
gqcn
added
the
bug
It is confirmed a bug, but don't worry, we'll handle it.
label
Oct 25, 2023
1. What version of
Go
and system type/arch are you using?go1.18.1, linux/amd64
2. What version of
GoFrame
are you using?v2.5.3
3. Can this issue be re-produced with the latest release?
yes
4. What did you do?
5. What did you expect to see?
panic err
6. What did you see instead?
mysql has no data, and the console also prints an error, but in fact err is nil
7. The problematic code
https://github.com/gogf/gf/blob/master/database/gdb/gdb_core.go#L468C3-L481C25
KeyListMap.Size() > 1
, andc.DoInsert
will be executed twice, and when the first iteration failed,return &sqlResult, nil
will set err to nil, causing err not to return8. How to solve it
The text was updated successfully, but these errors were encountered: