View Single Post
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 05-14-2022 , 17:17   Re: MYSQL - My first plugin
Reply With Quote #10

Quote:
Originally Posted by KateUhlerredalfias View Post
As someone who's written a storage engine plugin, I've found that executing a query from within a MySQL plugin is incredibly difficult. MySQL isn't re-entrant, due to locking within the MySQL process. You could use the MySQL client api (as suggested by chris) to connect to the same server. But it is 99% likely you will simply deadlock the whole server.
I dunno what you mean, MySQL works just fine with sourcemod even with some complex queries.
Its far more superior in data storing than anything else in my opinion when you're dealing with a lot of data. Of course depends what kind of plugin you're doing but still..
Its not that difficult, just organize your code well. The OPs question is quite simple.
He just wants to pull chat advertisements from the database which Bacardi gave an example script of already.

There's no deadlocking involved with such a simple plugin unless your code is somehow really bad..
You aren't doing that much inserting/updating from multiple sessions in this case that'd cause a deadlock in this situation.
InnoDB also detects deadlocks by default and rolls back the transactions to break the lock.
__________________
Rohanlogs is offline