From 3a0c314055494f48c89df552bfd35c7a37c5e390 Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Fri, 4 Jun 2021 16:15:03 +0800 Subject: [PATCH] 关闭prepare stmt --- src/utils/MysqlUtil.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/MysqlUtil.lua b/src/utils/MysqlUtil.lua index c92036c..c5d146f 100644 --- a/src/utils/MysqlUtil.lua +++ b/src/utils/MysqlUtil.lua @@ -30,24 +30,24 @@ end function addFriend(roleId, friendId) local stmt_csp = mysqlproxy:prepare("call add_friends(?, ?, ?)") - skynet.error(string.format("addFriend!!!!!!!!!,%s,%s,%s",roleId, friendId, skynet.timex())) - logdump(stmt_csp, '') + --logdump(stmt_csp, '') local r = mysqlproxy:execute(stmt_csp, roleId, friendId, skynet.timex()) if r[1][1]["t_error"] == 0 then rpcRole(roleId, "addFriend", friendId) rpcRole(friendId, "addFriend", roleId) end + mysqlproxy:stmt_close(stmt_csp) end function delFriend(roleId, friendId) local stmt_csp = mysqlproxy:prepare("call del_friends(?, ?)") - skynet.error(string.format("delFriend!!!!!!!!!,%s,%s",roleId, friendId)) - logdump(stmt_csp, '') + --logdump(stmt_csp, '') local r = mysqlproxy:execute(stmt_csp, roleId, friendId) if r[1][1]["t_error"] == 0 then rpcRole(roleId, "delFriend", friendId) rpcRole(friendId, "delFriend", roleId) end + mysqlproxy:stmt_close(stmt_csp) end function roleExists(roleId) -- libgit2 0.21.2