odd behavior from ndk.set_var.set_quote_sql_str

dannynoonan nginx-forum at nginx.us
Wed Oct 26 16:59:10 UTC 2011

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.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)

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

if i uncomment *either* the ngx.log or ngx.say, the quoted string is not
[david at dev-3]$ curl http://honey:8080/luaset 

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.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217260,217260#msg-217260

More information about the nginx mailing list