29.07.2013, 21:57
Hello,
So i am experiencing some weird behaviour of mysql.
It crashes sometimes on the queries and sometimes crashes on the storing result and sometimes freeing the result.
My MySql version is R14 and my VPS OS is Ubuntu 12.04.2 And this is the code that is being ran:
That makes it load the vehicles wich is this code:
What could it be crashing the server? It seems like nothing is wrong. Could it be the mysql version? Definetly not Ubuntu because it happens on CentOS too!
So i am experiencing some weird behaviour of mysql.
It crashes sometimes on the queries and sometimes crashes on the storing result and sometimes freeing the result.
My MySql version is R14 and my VPS OS is Ubuntu 12.04.2 And this is the code that is being ran:
pawn Код:
forward OnPlayerHousesLoad(playerid);
public OnPlayerHousesLoad(playerid)
{
new
rows,
fields
;
cache_get_data( rows, fields, Handle );
if( rows )
{
print("There are rows - Houses"); // Debugging
new idx = 0, string[128];
while( rows > idx )
{
APlayerData[playerid][Houses][idx] = cache_get_row_int( idx, 0 );
format(string, sizeof(string), "SELECT * FROM `Vehicles` WHERE `HouseID`= %d", APlayerData[playerid][Houses][idx]);
mysql_function_query( Handle, string, true, "OnPlayerHousesVehiclesLoad", "dd", playerid, APlayerData[playerid][Houses][idx] );
idx++;
}
}
return 1;
}
pawn Код:
forward OnPlayerHousesVehiclesLoad(playerid, houseid_);
public OnPlayerHousesVehiclesLoad(playerid, houseid_)
{
printf( "OnPlayerHousesVehiclesLoad::houseid_ = %d", houseid_ );
new rows, fields;
cache_get_data( rows, fields, Handle );
if( rows )
{
print("There are rows - Vehicles");
new
idx = 0,
cmodel2, Float: cx2, Float: cy2, Float: cz2, Float: crot2, ccol1, ccol2, _carid, mod[18];
while( rows > idx )
{
_carid = cache_get_row_int(idx, 1);
cmodel2 = cache_get_row_int( idx, 3 );
cx2 = cache_get_row_float( idx, 4 );
cy2 = cache_get_row_float( idx, 5 );
cz2 = cache_get_row_float( idx, 6 );
crot2 = cache_get_row_float( idx, 7 );
ccol1 = cache_get_row_int( idx, 8 );
ccol2 = cache_get_row_int( idx, 9 );
//Modding
mod[1] = cache_get_row_int(idx, 12);
mod[2] = cache_get_row_int(idx, 13);
mod[3] = cache_get_row_int(idx, 14);
mod[4] = cache_get_row_int(idx, 15);
mod[5] = cache_get_row_int(idx, 16);
mod[6] = cache_get_row_int(idx, 17);
mod[7] = cache_get_row_int(idx, 18);
mod[8] = cache_get_row_int(idx, 19);
mod[9] = cache_get_row_int(idx, 20);
mod[10] = cache_get_row_int(idx, 21);
mod[11] = cache_get_row_int(idx, 22);
mod[12] = cache_get_row_int(idx, 23);
mod[13] = cache_get_row_int(idx, 24);
mod[14] = cache_get_row_int(idx, 25);
mod[15] = cache_get_row_int(idx, 26);
mod[16] = cache_get_row_int(idx, 27);
mod[17] = cache_get_row_int(idx, 28);
printf("ccol1: %i, ccol2: %i", ccol1, ccol2);
printf("%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i", mod[1], mod[2], mod[3], mod[4], mod[5], mod[6], mod[7], mod[8], mod[9], mod[10], mod[11], mod[12], mod[13], mod[14], mod[15], mod[16], mod[17]);
printf("House_AddVehicle(%d,%d,%f,%f,%f,%f,%d,%d, %d);", houseid_, cmodel2, cx2, cy2, cz2, crot2, ccol1, ccol2, _carid);
House_AddVehicle(houseid_, cmodel2, cx2, cy2, cz2, crot2, ccol1, ccol2, _carid, playerid);
print("Car loaded");
idx++;
}
}
return 1;
}