• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Database exec multi parameters block callback

Mmoi

Active Member
Contributor
Hi,

Since the 1.0 beta3, the DBConn exec seem not to take the callback as a callback anymore. In fact, it is considered as a parameter and therefor crash the script.

Code:
dbConn.exec(table, function()
{
    sconomyLog(INFO, "Main table exists or created");
});

I get the following: 2019-06-29T22:32:31+02:00 error: sql: expected 0 arguments, got 1

Am I doing something wrong or is it broken?

Mmoi
 

Mmoi

Active Member
Contributor
And, regarding the note
Use this, if you expect a result set; Note: strings will be returned as byte arrays to be binary safe; to convert to actual strings, please use helpers.toString(column)
(cf here), the helpers.toString function seems to be broken too. This function just returns the original binary...
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Darn. Thanks for the feedback! I had to change a couple of things which probably affected those calls. Will fix it as soon as possible.
 

Mmoi

Active Member
Contributor
Hi, the bug is still present in 1.0.0 beta10, windows.

Any news on it?
Got users stuck with this bug
 

Eve3ment

Member
Hello this error will be fixed? I need this information because if not I will buy the ordered script in php.
 

Mmoi

Active Member
Contributor
For temp fix, as the real fix for the function seems to take way longer than expected.

Replace in the DB file:
JavaScript:
helpers.toString(column)

with:
JavaScript:
String.fromCharCode(...column.split(','))

Warning: untested
 
Top