T
T
Toopie2018-10-30 23:03:30
Nginx
Toopie, 2018-10-30 23:03:30

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'

I realized that this is already at the C level, I decided to look at the MySQL logs:
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)

Actually, the code itself:
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();

What could be the problem? Help me please.
Without a SQL query, everything works fine, the problem is right here ... I useresty.mysql

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DieZz, 2015-09-12
@Drm

Because a typo

if ($scope.balanceSort === '') {
              $scope.balaceSort = 'balance'; 
            }

$scope.balaceSort = 'balance' replace with $scope.bala n ceSort = 'balance';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question