Commit 89cc216ff445ddc97d96289e30475085dd123cde

Authored by liuzujun
2 parents 4a11ab64 3a0c3140

Merge branch 'cn/develop' into cn/publish/release

* cn/develop:
  关闭prepare stmt
Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
src/utils/MysqlUtil.lua
@@ -30,24 +30,24 @@ end @@ -30,24 +30,24 @@ end
30 30
31 function addFriend(roleId, friendId) 31 function addFriend(roleId, friendId)
32 local stmt_csp = mysqlproxy:prepare("call add_friends(?, ?, ?)") 32 local stmt_csp = mysqlproxy:prepare("call add_friends(?, ?, ?)")
33 - skynet.error(string.format("addFriend!!!!!!!!!,%s,%s,%s",roleId, friendId, skynet.timex()))  
34 - logdump(stmt_csp, '') 33 + --logdump(stmt_csp, '')
35 local r = mysqlproxy:execute(stmt_csp, roleId, friendId, skynet.timex()) 34 local r = mysqlproxy:execute(stmt_csp, roleId, friendId, skynet.timex())
36 if r[1][1]["t_error"] == 0 then 35 if r[1][1]["t_error"] == 0 then
37 rpcRole(roleId, "addFriend", friendId) 36 rpcRole(roleId, "addFriend", friendId)
38 rpcRole(friendId, "addFriend", roleId) 37 rpcRole(friendId, "addFriend", roleId)
39 end 38 end
  39 + mysqlproxy:stmt_close(stmt_csp)
40 end 40 end
41 41
42 function delFriend(roleId, friendId) 42 function delFriend(roleId, friendId)
43 local stmt_csp = mysqlproxy:prepare("call del_friends(?, ?)") 43 local stmt_csp = mysqlproxy:prepare("call del_friends(?, ?)")
44 - skynet.error(string.format("delFriend!!!!!!!!!,%s,%s",roleId, friendId))  
45 - logdump(stmt_csp, '') 44 + --logdump(stmt_csp, '')
46 local r = mysqlproxy:execute(stmt_csp, roleId, friendId) 45 local r = mysqlproxy:execute(stmt_csp, roleId, friendId)
47 if r[1][1]["t_error"] == 0 then 46 if r[1][1]["t_error"] == 0 then
48 rpcRole(roleId, "delFriend", friendId) 47 rpcRole(roleId, "delFriend", friendId)
49 rpcRole(friendId, "delFriend", roleId) 48 rpcRole(friendId, "delFriend", roleId)
50 end 49 end
  50 + mysqlproxy:stmt_close(stmt_csp)
51 end 51 end
52 52
53 function roleExists(roleId) 53 function roleExists(roleId)