Welcome! Log In Create A New Profile

Advanced

odd behavior from ndk.set_var.set_quote_sql_str

October 24, 2011 10:30PM
ndk.set_var.set_quote_sql_str sometimes treats the variable supplied as a param as if it were an empty string. the following config:


location /luaset {
content_by_lua "

local version = '2011.10.13+0000'
--ngx.say(version)
--ngx.log(ngx.ERR, version)
local e_version = ndk.set_var.set_encode_base32(version)
local s_version= ndk.set_var.set_quote_sql_str(version)
ngx.say(e_version)
ngx.say(s_version)
";
}


when hit with a basic get request:
[david@dev-3]$ curl http://<ip>:8080/luaset
68o32c9e64o2sc9j5co30c1g
''
returns a quoted empty string.

if i uncomment *either* the ngx.log or ngx.say, the quoted string is not empty:
[david@dev-3]$ curl http://honey:8080/luaset
68o32c9e64o2sc9j5co30c1g
'2011.10.13+0000'

is there something about lua variables i don't understand? how could referencing the variable once before the sql conversion have an effect? i can repro this over and over.
Subject Author Posted

odd behavior from ndk.set_var.set_quote_sql_str

dannynoonan October 24, 2011 10:30PM

Re: odd behavior from ndk.set_var.set_quote_sql_str

agentzh October 27, 2011 07:58AM

Re: odd behavior from ndk.set_var.set_quote_sql_str

dannynoonan October 27, 2011 01:28PM

Re: odd behavior from ndk.set_var.set_quote_sql_str

agentzh October 28, 2011 11:22AM

Re: odd behavior from ndk.set_var.set_quote_sql_str

dannynoonan October 27, 2011 07:39PM

Re: odd behavior from ndk.set_var.set_quote_sql_str

agentzh October 28, 2011 11:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready