From 5db8b87a218d2408e1dd3ff0924002061dce5026 Mon Sep 17 00:00:00 2001 From: loshiqi <553578653@qq.com> Date: Fri, 26 Apr 2024 14:56:31 +0800 Subject: [PATCH] =?UTF-8?q?transaction=20=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transaction.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transaction.go b/transaction.go index cbfd9de..b755243 100644 --- a/transaction.go +++ b/transaction.go @@ -25,7 +25,7 @@ func TxInsert(tx *sql.Tx, dbname, table string, data map[string]string) (int64, if strings.Contains(table, "select ") { dbName = table } else { - dbName = getTableName(dbName, table) + dbName = getTableName(dbname, table) } if len(data) < 1 { return 0, errors.New("参数错误,没有要写入的数据") @@ -186,7 +186,7 @@ func TxPreUpdate(tx *sql.Tx, dbname, table string, data []string, where []string if strings.Contains(table, "select ") { dbName = table } else { - dbName = getTableName(dbName, table) + dbName = getTableName(dbname, table) } if len(where) < 1 { @@ -228,7 +228,7 @@ func TxDelete(tx *sql.Tx, dbname, table string, where map[string]string, del_cou if strings.Contains(table, "select ") { dbName = table } else { - dbName = getTableName(dbName, table) + dbName = getTableName(dbname, table) } if len(where) < 1 { return count, errors.New("参数错误,没有删除条件")