tmysql4 - A multi-connection version of tmysql3 (Now with mysqloo wrapper!)
384 replies, posted
snip
Thank you so much Awp!
I got this error and managed to fix it!
[img]http://puu.sh/kQJXe/889108165b.png[/img]
[editline]20th October 2015[/editline]
I have a quick question now BlackAWP,
It seems that ARCBank only uses MySQLOO ? How do i use your wrapper for it.
[url]http://pastebin.com/bCTgHKXG[/url]
First line says how to install the wrapper.
[code]-- TO INSTALL: SAVE AS lua/includes/modules/mysqloo.lua and have tmysql4 installed in lua/bin[/code]
[QUOTE=BlackAwps;48942474][url]http://pastebin.com/bCTgHKXG[/url]
First line says how to install the wrapper.
[code]-- TO INSTALL: SAVE AS lua/includes/modules/mysqloo.lua and have tmysql4 installed in lua/bin[/code][/QUOTE]
Thank You!
Multi statements stopped working today out of nowhere, tells me there's a syntax error.
[code]INSERT INTO apt_entvars (`entid`, `variable`, `value`) VALUES (13326, "items", "[]") ON DUPLICATE KEY UPDATE `entid` = VALUES(`entid`), `variable` = VALUES(`variable`), `value` = VALUES(`value`);
INSERT INTO apt_entvars (`entid`, `variable`, `value`) VALUES (13326, "furniture_id", "163") ON DUPLICATE KEY UPDATE `entid` = VALUES(`entid`), `variable` = VALUES(`variable`), `value` = VALUES(`value`);[/code]
i don't get it
Can you post the syntax error? Was this after you updated the dll?
[code]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO apt_entvars (`entid`, `variable`, `value`) VALUES (13556, "chem_comp' at line 2[/code]
i honstly don't know
Okay, again. That's not helpful for me. That doesn't seem to match the thing you originally posted and you didn't even give me the whole query. You also didn't answer my question if this started happening AFTER you updated the dll.
there's hundreds of lines, bulk insert, they all give the same errors
but yeah i think it happened before, and that dll was like 600kb
I don't know what to tell you. CLIENT_MULTI_STATEMENTS works fine here for me.
Are you sure you have the flag set?
I just ran a simple multi-query with the latest module and it ran fine.
[code]"SELECT * FROM test; SELECT 1+3; SELECT 5*3"[/code]
[code]1:
affected = 3
data:
1:
double = 12345.6789
float = 13.37
id = 1
string = This is a string
2:
double = 0
float = 0
id = 2
string = test1
3:
double = 0
float = 0
id = 3
string = test1
lastid = 0
status = true
2:
affected = 1
data:
1:
1+3 = 4
lastid = 0
status = true
3:
affected = 1
data:
1:
5*3 = 15
lastid = 0
status = true[/code]
yep, multi statements are enabled
[code]DB_CONN:Query("SELECT 1+3; SELECT 5*3;", PrintTable)[/code]
[code]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 5*3' at line 1[/code]
Uhhh, I don't think it is man.
[code]lua_run DATABASE:Query("SELECT 1+3; SELECT 5*3;", PrintTable)
> DATABASE:Query("SELECT 1+3; SELECT 5*3;", PrintTable)...
1:
affected = 1
data:
1:
1+3 = 4
lastid = 0
status = true
2:
affected = 1
data:
1:
5*3 = 15
lastid = 0
status = true
[/code]
Is this Linux or Windows? I'm running this on Linux so maybe it's an issue with the windows version?
windows, dll hash is F48E802225D92427D3A34BFF3EF58A1E
Uhh, I don't know what type of hash that is, but it doesn't match anything I have.
[img]http://i.imgur.com/GTNk7Gu.png[/img]
Can you please redownload the module in the OP and try again? It's working fine for me on windows as well.
[img]http://i.imgur.com/qYqGm4p.png[/img]
SHA1 820DAA1BAAD94CC56C837735119DC69B6B078810
it's the same
god damnit wtf is this
the newest one didn't require any external libs right?
Yep, no external dependencies at all. Everything is statically linked. You should really check and see if your flag is being set correctly. Heck, maybe your MySQL server updated and got fucked? I really don't know.
it's using the exact code as in the example, and i haven't touched the sql server in ages
Does the original module work, the one that required external dependencies?
[url]http://breakpoint.me/gmsv_tmysql4_win32.dll[/url]
Because honestly, I really don't know what else to tell you. I can't replicate your issue on my end.
nope, doesn't seem to work either
Thennnn something changed on your system, seeing how you said it just randomly stopped working. I don't think the module is at fault here and there's not much else I can do to try and help. I would say poke around at your mysql server config and see what's up. For whatever reason it seems to be ignoring the CLIENT_ flag.
oh boy.. disconnecting the db and then reconnecting seems to fix it
maybe the client flag enums are not set early enough?
The client flags are literally used right away when it connects to the server. I haven't touched the connect code in years and seeing how it's doing the same thing in the old version, something else is at fault. Try rebooting your SQL server maybe?
i did, no change
i can however reproduce it working every time by disconnecting and connecting, and then multi statements work
That's super strange.
[url]https://bitbucket.org/breakpointservers/bkacjios-glua-modules/src/c2d54eb24ba98c90911c88e01a9a4f6da3660526/gm_tmysql4/src/database.cpp?at=default&fileviewer=file-view-default#database.cpp-47[/url]
The client flags are passed to the Database object tmysql.inititalize creates. There should be no reason for it to be ignored the first time around. I don't know man. You got a strange ass issue that makes no sense at all.
yeah i can't have my server running with this broken, and disconnecting and reconnecting has a huge chance of the server crashing or making other addons that have their own libraries break
[QUOTE=Giraffen93;48947551]yeah i can't have my server running with this broken, and disconnecting and reconnecting has a huge chance of the server crashing or making other addons that have their own libraries break[/QUOTE]
i don't see how..?
i mean its not the modules fault that your server seems to be freaking out, you'll likely get the same issue with any of the alternatives.
[QUOTE=Map in a box;48948484]i don't see how..?
i mean its not the modules fault that your server seems to be freaking out, you'll likely get the same issue with any of the alternatives.[/QUOTE]
nothing seems to be causing it, so i can't fix it
i can't have any alternatives, gonna have to stop everything since it depends on it
As silly of a hack as it is, reconnecting to the sql server certainly won't cause server crashes lol I don't know where you're getting that
if it do it enough times, it will
[editline]21st October 2015[/editline]
this isn't interfering with other wrappers right? because there are a few being used on the server at the same time
tmysql suddenly stopped reacting to db:Query in any way. Callback wasn't called at all.
After trying some simple queries like "select 1+1" and still getting no response, not even an error, i decided to reconnect to database (server was live with players, i had to restore database connection asap). I call db:Disconnect() before attempting new connection and server crashes.
OH COME ON Almost a year passed from [url=https://facepunch.com/showthread.php?t=1441753&p=46726945&viewfull=1#post46726945]this post[/url]! Not only db:Disconnect crash is still there, but now it also randomly stops working!
There is no reason connection could be lost, gmod and sql server are on same machine. And even then, it should error when connection is lost, not just stop responding at all.
[editline]21st October 2015[/editline]
Also, in my wrapper, it is not possible for db:Disconnect() to be called twice on the same db object, because variable that holds object is set to nil immediately after calling :Disconnect(). So, when i called :Disconnect() manually, it was first call of this function on this db object. This crash is not even the main issue though, callback not being called is. But these two issues are probably connected anyway.
I can't provide any error IDs because callback wasn't called at all, and i can't do further testing on broken db object because server crashed.
[editline]21st October 2015[/editline]
We have something like 8 gmod servers on one machine, and several of them use 2 tmysql connections (one for admin system, another one for darkrp). This may or may not be connected to the issue.
Sorry, you need to Log In to post a reply to this thread.