Mysql question -
KinderClans - 24.10.2018
I know this would sound stupid, but i'm doing a test.
Currently i'm using MySQL R41-4, and i decided to add R39-6 too.
So i downloaded R39-6 package and renamed a_mysql.inc and mysql.dll to a_mysql_old.inc and mysqlold.dll.
Included in the gamemode, added mysqlold.dll to plugins folder and started server.
Problem:
Server loads 90% of mysql things, then i get in mysql log: "mysql_tquery: Invalid connection handle "14"" at a random callback.
I have only ONE mysql_connect on OnGameModeInit, what can be the cause?
Some logs:
Quote:
[17:37:00] [plugins/mysql] mysql_format: invalid connection handle '14' (test.pwn:10699 -> test.pwn:10846
[17:37:00] [plugins/mysql] mysql_tquery: invalid connection handle '14' (test.pwn:10700 -> test.pwn:10846
[17:37:18] [plugins/mysql] mysql_format: invalid connection handle '14' (test.pwn:8551)
[17:37:18] [plugins/mysql] mysql_tquery: invalid connection handle '14' (test.pwn:8552)
|
Re: Mysql question -
NaS - 24.10.2018
Since both plugins have many natives in common there will be conflicts. Eg. some natives will only work for the old one and others for the new one.
mysql_connect for example exists on both, I'm not sure if it will call the new one or the old one, but it probably not work out very well...
Re: Mysql question -
KinderClans - 24.10.2018
So what i have to do to fix it?
Re: Mysql question -
NaS - 24.10.2018
Recompile the old or new plugin with changed natives (there might be more conflicts than natives though). Or just use one.
Re: Mysql question -
KinderClans - 24.10.2018
Ok so you are telling me to remove mysql_connect from R39-6 plugin and recompile it? How to recompile the plugin?
Re: Mysql question -
Beckett - 24.10.2018
Why are you using two MySQL plugins simultaneously in the first place?
Re: Mysql question -
KinderClans - 24.10.2018
Quote:
Originally Posted by DaniceMcHarley
Why are you using two MySQL plugins simultaneously in the first place?
|
As i said in first post, i'm doing a test.
Re: Mysql question -
Infin1ty - 24.10.2018
Use r41-4 and not r39-6. Send us your mysql_connect line, if you wish you may censor your database connection information.
Re: Mysql question -
KinderClans - 24.10.2018
Quote:
Originally Posted by Infin1ty
Use r41-4 and not r39-6. Send us your mysql_connect line, if you wish you may censor your database connection information.
|
I need to use both for now.
No need to censor anything since database information are stored in defines.
pawn Код:
/* ---- MySQL Defines ---- */
new MySQLOpt: option_id = mysql_init_options();
mysql_set_option(option_id, AUTO_RECONNECT, true);
g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, option_id);
if (g_SQL == MYSQL_INVALID_HANDLE || mysql_errno(g_SQL) != 0)
{
print("MySQL connection failed. Server is shutting down.");
SendRconCommand("exit");
return 1;
}
print("MySQL connection is successful.");
/* ----------------------- */
Re: Mysql question -
Infin1ty - 24.10.2018
Код:
new MySQLOpt: option_id = mysql_init_options();
mysql_set_option(option_id, AUTO_RECONNECT, true);
g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, option_id);
Get rid of all of this. This is bad practice. How hard is it for people to understand that MySQL automatically reconnects
by default?
Код:
g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE);
This is what your g_SQL variable should become. Also, when defining the g_SQL variable, are you using the MySQL: tag before it?