hi,做小白鼠~测试您的 lua-resty-postgres ,errlogs错误如下:
2013/06/13 15:45:15 [error] 372#0: *346 lua entry thread aborted: runtime error: /home/sunday/local/lualib/resty/postgres.lua:74: attempt to index upvalue 'bit' (a nil value)
stack traceback:
coroutine 0:
/home/sunday/local/lualib/resty/postgres.lua:74: in function '_set_byte4'
/home/sunday/local/lualib/resty/postgres.lua:101: in function '_send_packet'
/home/sunday/local/lualib/resty/postgres.lua:220: in function 'connect'
/home/sunday/local/nginx/html/cpu.lua:6: in function </home/sunday/local/nginx/html/cpu.lua:1>, client: 58.63.47.115, server: xxx.xxx.xxx, request: "GET /scc HTTP/1.1", host: "xxx.xxx.xxx.xxx:xxxx"
检查似乎是在这一行,数据库的配置是正确的,不知是何原因。
return string.char(bit.band(bit.rshift(n, 24), 0xff), bit.band(bit.rshift(n, 16), 0xff),bit.band(bit.rshift(n, 8), 0xff), bit.band(n, 0xff))