Answer the question
In order to leave comments, you need to log in
Attempt to yield across C-call boundary when working with MySQL?
Hello.
I wrote a program in Lua, I make a SQL query, I get an error in the nginx logs:
2018/10/30 15:59:33 [error] 5560#5560: *499 lua entry thread aborted: runtime error: attempt to yield across C-call boundary
stack traceback:
coroutine 0:
[C]: in function 'require'
2018-10-30T19:52:17.621811Z 656 [Note] Aborted connection 656 to db: 'telegraph' user: 'root' host: 'localhost' (Got an error reading communication packets)
2018-10-30T19:52:52.634161Z 657 [Note] Aborted connection 657 to db: 'telegraph' user: 'root' host: 'localhost' (Got an error reading communication packets)
2018-10-30T19:52:52.848637Z 658 [Note] Aborted connection 658 to db: 'telegraph' user: 'root' host: 'localhost' (Got an error reading communication packets)
2018-10-30T19:54:11.180515Z 659 [Note] Aborted connection 659 to db: 'telegraph' user: 'root' host: 'localhost' (Got an error reading communication packets)
local sql = 'INSERT INTO `users` (`login`, `email`, `password`, `access_token`, `reg_ip`, `auth_ip`, `created_at`, `updated_at`) VALUES (\'' .. login .. '\', \'' .. email .. '\', \'' .. ngx.md5(password) .. '\', \'' .. access_token .. '\', \'' .. user_ip .. '\', \'' .. user_ip .. '\', \'' .. time .. '\', \'' .. time .. '\')';
local result = db:query(sql);
db:close();
resty.mysql
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question