server crashes after sending query
#1

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?
Reply
#2

Bump
Reply
#3

Where did you define your variable called temp?
Reply
#4

Right there on loading!
Reply
#5

My bad. Is it big enough for mysql to write to it?
Reply
#6

Yes it is
Reply
#7

This
pawn Код:
cache_get_row(0,2,temp);
Should be this
pawn Код:
cache_get_row(0,0,temp);
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
Reply
#8

Genius! So obvious and yet i failed to notice...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)