intercept / intercept-database

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

Add support for % #18

Closed th3-sh0w3r closed 5 years ago

th3-sh0w3r commented 5 years ago

Hey there,

My query looks like this: SELECT id FROM gangs WHERE members LIKE %?% AND active=1 The problem here is that you cannot leave the % without a ' because you get an error then. And if I put the ' arround the %?% there is an error because it can't find the ? and says:


__________ DB-ERROR ___________
Error: Invalid number of bind values. Expected 0 got 1
Code: 2
Query: SELECT id FROM gangs WHERE members LIKE '%?%' AND active=1

Error in expression <interceptOnFrame>
Error position: <interceptOnFrame>
Error Intercept-DB exception Invalid number of bind values. Expected 0 got 1
at
SELECT id FROM gangs WHERE members LIKE '%?%' AND active=1

And if some error occurs with intercept-db the whole arma3 server just crashes. Maybe you can fix that in future.

th3-sh0w3r commented 5 years ago

Ok I found a solution for my issue. I'm using concat now. CONCAT('%', ? ,'%');

So what about the server crashes?

dedmen commented 5 years ago

And if some error occurs with intercept-db the whole arma3 server just crashes.

Bug. There should be exception handlers for everything. Do you have a .mdmp from the server crash? Can you send that?

th3-sh0w3r commented 5 years ago

I've bidmp files, are they ok? https://workupload.com/archive/GPrj33a

There are exceptions in the RPT protocol, but the server still crashes.

dedmen commented 5 years ago

No. only mdmp are useful.

th3-sh0w3r commented 5 years ago

How do I get mdmp?

dedmen commented 5 years ago

They are put next to the RPT/bidmp on a crash.

th3-sh0w3r commented 5 years ago

Hey,

here is my MDMP File: arma3server_x64_2019-07-18_04-41-24.zip

dedmen commented 5 years ago

which intercept DB version were you using? I tried every version back to 1.2 and couldn't find any match.

th3-sh0w3r commented 5 years ago

Hey, I‘m using 1.5 but I build it with VS. I just changed 3 lines there, toParsedArray converts numbers with more than 6 digits to a String. It worked before. But since I‘m using 1.5 it crashes every time the server loaded completely or it crashes just random while starting. No errors. Nothing

dedmen commented 5 years ago

I can't debug your own build without pdb files. But if you built yourself you could debug it yourself and find out why it crashes.

th3-sh0w3r commented 5 years ago

How do I debug it? Should I send you the pdb files?

th3-sh0w3r commented 5 years ago

Ok I fixed the crashes, it was because too much calls/asyncalls at the same time (loop). I had like 150 calls with no uiSleep in it. I‘ve added uiSleep 0.01; and now it works. Maybe there should be a queue with a little delay, that something like this doesn‘t happen. Sometimes it crashes already with 5 calls at the same time (call after call but with no sleep)