intercept / intercept-database

A database library for Intercept
MIT License
14 stars 9 forks source link

Unknown MySQL Error #23

Open FairyTale5571 opened 4 years ago

FairyTale5571 commented 4 years ago

After 3 hours of successful work, problems with writing to the database begin; reading did not check. I get the error in rpt below.

19:37:24 Error in expression <interceptOnFrame> 19:37:24 Error position: <interceptOnFrame> 19:37:24 Error Intercept-DB exception: Invalid number of bind values. Expected 16129 got 2 at INSERT INTO performance_log (type,value,timestamp) VALUES (?,?,NOW())

MySQL Server was working normally

FairyTale5571 commented 4 years ago

https://i.imgur.com/TSChe2X.png

dedmen commented 4 years ago

Expected 16129 got 2

🙃

Looks pretty random. Does it recover by itself or do you need to restart? Can you show the code that executes that? Are you using CopyQuery command and then bind? Or recreate query everytime?

FairyTale5571 commented 4 years ago

It recovers on its own

_fnc = { params ["_cname", ["_params", []]]; private "_query"; if (_params isEqualTo []) then { _query = dbPrepareQueryConfig _cname; } else { _query = dbPrepareQueryConfig [_cname, _params]; }; private _res = InterceptDatabase dbExecuteAsync _query;

} ["insertPerformance",["FPS",diag_fps toFixed 2]] call _fnc;

dedmen commented 4 years ago

if (_params isEqualTo []) then {

no need for that. _query = dbPrepareQueryConfig [_cname, []]; would also be valid.

It recovers on its own

how fast? Looks like some pretty random memory error, can't really explain that to myself.

FairyTale5571 commented 4 years ago

hm.. 5-10 min it recovered. Could this be because I am sending too many queries to the database?

0x1F9F1 commented 3 years ago

Did you ever figure out the cause of this? I've come across an almost identical issue with my own extdb extension, right down to the exact same invalid number of params.