From 00943e75eda77b533f7ae982dfad3afae7c70286 Mon Sep 17 00:00:00 2001 From: zhenghaorong Date: Sat, 3 Sep 2022 14:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E6=96=B9=E6=B3=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transaction_chain.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/transaction_chain.go b/transaction_chain.go index c2a5ceb..561c282 100644 --- a/transaction_chain.go +++ b/transaction_chain.go @@ -405,10 +405,7 @@ func (this *TxQuery) UpdateAllStmt() error { if len(valSql) > 1 { setText = " value " } - sql = helper.StringJoin("insert into ", dbName, " (", strings.Join(this.data, " , "), ")", setText, strings.Join(valSql, ",")) - if len(this.value) == 0 { - return errors.New("参数错误,条件值错误") - } + sql = helper.StringJoin("insert into ", dbName, " (", strings.Join(this.data, " , "), ")", setText, strings.Join(valSql, ","), " ON DUPLICATE KEY UPDATE ", strings.Join(updSql, " , ")) if this.debug { log.Println("insert on duplicate key update sql:", sql, this.value)