MySQL R7 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL R7 (
/showthread.php?tid=399450)
MySQL R7 -
GiS - 14.12.2012
Hello,
I'm using BlueG's MySQL R7 Plugin and have one question left over. It has been mentioned that all queries are now threaded. Does that mean that I can do the following and just keep coding below it as it will just not wait for MySQL to finish?:
pawn Код:
// Would this cause any issues (e.g. lag)?
mysql_function_query(handle, "INSERT INTO `table` (`column`) VALUES ('value')", false, "" "");
SetPlayerPos(/* ... */);
GetPlayerPos(/* ... */);
PutPlayerInVehicle(/* ... */);
// ...
I hope you understand my question - as in R6 I used OnQueryFinish to continue my code as it would await the finish of the query before doing anything else.
Re: MySQL R7 -
Virtual1ty - 14.12.2012
Yes, the mysql_function_query only puts your query to some queue and awaits for it execution, which is apart from the PAWN VM and runs in its own thread. Any code below mysql_function_query gets executed as it should, meaning no delay..
Oh, and by the way, if you haven't already, you should check this tutorial for all vitally explained differences from R6 to R7:
https://sampforum.blast.hk/showthread.php?tid=337810
Re: MySQL R7 -
GiS - 14.12.2012
Quote:
Originally Posted by Virtual1ty
Yes, the mysql_function_query only puts your query to some queue and awaits for it execution, which is apart from the PAWN VM and runs in its own thread. Any code below mysql_function_query gets executed as it should, meaning no delay..
Oh, and by the way, if you haven't already, you should check this tutorial for all vitally explained differences from R6 to R7:
https://sampforum.blast.hk/showthread.php?tid=337810
|
Thanks, and yeah, I already did check it out but I was unsure about this tiny detail so I better asked. So the only thing I got to take care now is that when I need a result of the query that I then need to use the callbacks.
Re: MySQL R7 -
Virtual1ty - 14.12.2012
Yes, when you want to do something with the returned set (if any) you must use callbacks.