From b4a56e10b7e0e20bb8097e088440dc0e8feb94c2 Mon Sep 17 00:00:00 2001 From: jiefenghuang Date: Thu, 19 Dec 2024 13:38:54 +0800 Subject: [PATCH] meta/sql: fix sql batch insert (#5397) Signed-off-by: jiefenghuang --- pkg/meta/sql_bak.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/meta/sql_bak.go b/pkg/meta/sql_bak.go index 04265bf9cd58..db99dc1140b9 100644 --- a/pkg/meta/sql_bak.go +++ b/pkg/meta/sql_bak.go @@ -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) }