Mysql Problem (server crash) -
Andrei1255 - 24.06.2017
Hi ! I use plugin Mysql R6 and when I try to start my server , I get the following error :
[11:52:49] [debug] #0 native mysql_fetch_field_row () from mysql.so
Script:
format(Query, sizeof(Query), "SELECT * FROM clanuri WHERE id='%d'", rowid);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows())
{
mysql_retrieve_row();
new Field[128];
mysql_fetch_field_row(ClanInfo[i][cNume], "Nume");
}
I see that it happens only when I have "SELECT * " , but if I select just one field ("SELECT blablabla") , it doesn't crash. Also if I select everything ("SELECT * ") without any mysql_fetch_field_row , the server doesn't crash.
Any idea how to solve this ? Thanks !
Re: Mysql Problem (server crash) -
JasonRiggs - 24.06.2017
Tried changing the version?
Re: Mysql Problem (server crash) -
Andrei1255 - 24.06.2017
The R7 version is only available for Ubuntu , and the OS of my host is Debian . R5 also doesn't work .
Other idea's , please ?
Re: Mysql Problem (server crash) -
DRIFT_HUNTER - 24.06.2017
You are doing it wrong. mysql_retrieve_row may fail or whatever, that's why it returns 1/0, you are not checking if that failed and you are trying to get field (column) anyway.
pawn Код:
format(Query, sizeof(Query), "SELECT * FROM clanuri WHERE id='%d'", rowid);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows())
{
new Field[128];
while(mysql_retrieve_row())
{
mysql_fetch_field_row(ClanInfo[i][cNume], "Nume");
}
}
EDIT: Oh and by the way, since you are using linux, i suggest you to use latest mysql plugin version since linuxes are dropping support for older mysql-client libraries (meaning you would need to recompile plugin yourself or use 3rd party repositories)
Re: Mysql Problem (server crash) -
Andrei1255 - 25.06.2017
Ok, this way it doesn't crash anymore, but it still doesn't read the row :
mysql_fetch_field_row(Field, "SpawnX"); ClanInfo[i][cSpawnx] = floatstr(Field);
mysql_fetch_field_row(Field, "SpawnY"); ClanInfo[i][cSpawny] = floatstr(Field);
mysql_fetch_field_row(Field, "SpawnZ"); ClanInfo[i][cSpawnz] = floatstr(Field);
Here, the variables don't change their value, they're still 0.0 .
On other host it worked good , with the code I showed in the first post and same plugin (MySLQ R6) , but on CentOS (now it is on Debian) .
Other idea's .. ?