Skip to content

Commit

Permalink
meta/sql: fix sql batch insert (#5397)
Browse files Browse the repository at this point in the history
Signed-off-by: jiefenghuang <[email protected]>
  • Loading branch information
jiefenghuang authored Dec 19, 2024
1 parent 217eb00 commit b4a56e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/meta/sql_bak.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func (m *dbMeta) insertRows(beans []interface{}) error {
for len(beans) > 0 {
bs := utils.Min(batch, len(beans))
err := m.txn(func(s *xorm.Session) error {
n, err := s.Insert(beans[:bs]...)
n, err := s.Insert(beans[:bs])
if err == nil && int(n) != bs {
err = fmt.Errorf("only %d records inserted", n)
}
Expand Down

0 comments on commit b4a56e1

Please sign in to comment.