server crashes after sending query - 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: server crashes after sending query (
/showthread.php?tid=427372)
server crashes after sending query -
dusk - 01.04.2013
Okay here is the query:
[/pawn]mysql_function_query(dbHandle,"SELECT Vardas FROM PoliceFiles WHERE Ieskomas != 0",true,"OnPFileLoad","d",playerid);[/pawn]
And the callback:
pawn Код:
forward OnPFileLoad(playerid);
public OnPFileLoad(playerid)
{
new rows,fields,temp[32],string[128];
cache_get_data(rows,fields);
for(new i; i<rows; i++)
{
cache_get_row(0,2,temp);
format(string,sizeof(string),"%s\n",temp);
strins(string,temp,0);
printf("%d",rows);
printf(temp);
printf(string);
}
ShowPlayerDialog(playerid,DIALOG_PFILEWANTED,DIALOG_STYLE_MSGBOX,"Ieskomi asmenys",string,"Gerai","");
return 1;
}
crash detect:
pawn Код:
[17:28:52] [debug] Server crashed while executing rp.amx
[17:28:52] [debug] AMX backtrace:
[17:28:52] [debug] #0 native cache_get_row () [001a2510] from mysql.so
[17:28:52] [debug] #1 000504d8 in public OnPFileLoad () from rp.amx
[17:28:52] [debug] System backtrace:
[17:28:52] [debug] #0 0046cecb in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[17:28:52] [debug] #1 00464c69 in _ZN11CrashDetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[17:28:52] [debug] #2 00466c99 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[17:28:52] [debug] #3 0046c9d8 in ?? () from plugins/crashdetect.so
[17:28:52] [debug] #4 00e33600 in ?? ()
[17:28:52] [debug] #5 0088c313 in strlen () from /lib/libc.so.6
[17:28:52] [debug] #6 08094ce5 in ?? () from ./bebrassamp
[17:28:52] [debug] #7 0019c989 in _ZN6StrAmx10SetCStringEP6tagAMXiPci () from plugins/mysql.so
[17:28:52] [debug] #8 001a2598 in _ZN7Natives15n_cache_get_rowEP6tagAMXPi () from plugins/mysql.so
[17:28:52] [debug] #9 080938e4 in ?? () from ./bebrassamp
[17:28:52] [debug] #10 00466f37 in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[17:28:52] [debug] #11 00469268 in ?? () from plugins/crashdetect.so
[17:28:52] [debug] #12 0046f2c2 in amx_Exec () from plugins/crashdetect.so
[17:28:52] [debug] #13 00466e1e in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[17:28:52] [debug] #14 004692de in ?? () from plugins/crashdetect.so
[17:28:52] [debug] #15 001a69dc in ProcessTick () from plugins/mysql.so
[17:28:52] [debug] #16 080c5a32 in ?? () from ./bebrassamp
[17:28:52] [debug] #17 080b57fc in ?? () from ./bebrassamp
[17:28:52] [debug] #18 080b10a3 in ?? () from ./bebrassamp
[17:28:52] [debug] #19 0082fc76 in __libc_start_main () from /lib/libc.so.6
[17:28:52] [debug] #20 0804b521 in ?? () from ./bebrassamp
There are printf,they do not get printed. Anyone can help?
Re: server crashes after sending query -
dusk - 04.04.2013
Bump
Re: server crashes after sending query -
Sithis - 04.04.2013
Where did you define your variable called temp?
Re: server crashes after sending query -
dusk - 04.04.2013
Right there on loading!
Re: server crashes after sending query -
Sithis - 04.04.2013
My bad. Is it big enough for mysql to write to it?
Re: server crashes after sending query -
dusk - 04.04.2013
Yes it is
Re: server crashes after sending query -
InfiniTy. - 04.04.2013
This
Should be this
You are selecting just one field(Vardas) but and then you were trying to get the data from 3rd field from that query..(which doesn't exist)
pawn Код:
#0 native cache_get_row () [001a2510] from mysql.so
Re: server crashes after sending query -
dusk - 04.04.2013
Genius! So obvious and yet i failed to notice...