Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad argument #3 to 'format' #26

Open
littlexsparkee opened this issue Aug 12, 2020 · 1 comment
Open

bad argument #3 to 'format' #26

littlexsparkee opened this issue Aug 12, 2020 · 1 comment

Comments

@littlexsparkee
Copy link

The full error is

FATAL: `thread_run' function failed: ...cal/Cellar/sysbench/1.0.17_1/share/sysbench/tpcc_run.lua:648: bad argument #3 to 'format' (number expected, got nil)

It seems to happen randomly, some long runs complete and some shorter ones encounter this right at the start. The error points to this command:

UPDATE customer%d
                        SET c_balance = c_balance + %f,
                            c_delivery_cnt = c_delivery_cnt + 1
                      WHERE c_id = %d
                        AND c_d_id = %d
                        AND c_w_id = %d]])
                      :format(table_num, sm_ol_amount, o_c_id, d_id, w_id)

When I run the query that generates o_c_id, I get a value though. It's quite puzzling; I thought it had to do with data corruption from exiting the command unexpectedly but it happens even after a fresh prepare and not tampering with anything. Hopefully you can shed some light on it. Thanks.

@y-trudeau
Copy link

I am having the same issue, hard to find any fault. It happens only with concurrency (more than one thread). At 8 threads I am seeing the issue about once per 1000s. I fixed it adding:

if o_c_id ~= nil then

After the select returning o_c_id to exclude the remaining of new_order if a nil is retuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants