-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors with local 'len' variable #50
Comments
function _from_length_coded_bin() return 2016-08-25 19:07 GMT+08:00 Dmitry Kuzmin notifications@github.com:
|
Can i help you somehow to fix this ASAP? |
@th0rb can you add in this line: https://github.com/openresty/lua-resty-mysql/blob/master/lib/resty/mysql.lua#L288 ngx.log(ngx.ERR, tostring(first)) And report what got logged? |
@th0rb Please try this patch: diff --git a/lib/resty/mysql.lua b/lib/resty/mysql.lua
index 99a253e..7860192 100644
--- a/lib/resty/mysql.lua
+++ b/lib/resty/mysql.lua
@@ -286,14 +286,14 @@ local function _from_length_coded_bin(data, pos)
return _get_byte8(data, pos)
end
- return false, pos + 1
+ return nil, pos + 1
end
local function _from_length_coded_str(data, pos)
local len
len, pos = _from_length_coded_bin(data, pos)
- if len == nil or len == null then
+ if not len or len == null then
return null, pos
end |
@agentzh thanks, will try it now |
@agentzh well, error disapeared, thank a lot for your help. Hope this fix find its way to next release |
@th0rb Thanks for the feedback! Just committed to master. And yes, it will get included in the next release. |
*454 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/mysql.lua:300: attempt to perform arithmetic on local 'len' (a boolean value) stack traceback: coroutine 0: /usr/local/openresty/lualib/resty/mysql.lua: in function '_from_length_coded_str' /usr/local/openresty/lualib/resty/mysql.lua:423: in function '_parse_row_data_packet' /usr/local/openresty/lualib/resty/mysql.lua:870: in function 'query'
This error appeared after we migrate to MYSQL 5.7.14, in previous versions everything was ok.
currently we use:
openresty/1.11.2.1
lua-resty-mysql-0.16
The text was updated successfully, but these errors were encountered: