From bf1664b48bf2c3a6fb8f477a325515c04f72ccf4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 5 Jun 2024 14:08:15 +0800 Subject: [PATCH] 1 --- dbpool.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbpool.go b/dbpool.go index 66a2d17..82b6e1a 100644 --- a/dbpool.go +++ b/dbpool.go @@ -206,7 +206,9 @@ func (this *dbPool) Upsert( return } if ds.Next() { - this.Update(dataSource, tblName, whereKv, updateKv, cb) + if len(updateKv) > 0 { + this.Update(dataSource, tblName, whereKv, updateKv, cb) + } } else { this.Insert(dataSource, tblName, insertKv, cb) }