lua-resty-mysql icon indicating copy to clipboard operation
lua-resty-mysql copied to clipboard

fix issue #94 :need to close db connection if res is nil.

Open zhiyong0804 opened this issue 5 years ago • 0 comments

add db:close when query failed.

res, err, errcode, sqlstate = db:query("select 1; select 2; select 3;") if not res then ngx.log(ngx.ERR, "bad result #1: ", err, ": ", errcode, ": ", sqlstate, ".") db:close() return ngx.exit(500) end


This change is Reviewable

zhiyong0804 avatar Sep 15 '19 03:09 zhiyong0804