MYSQL crash problems
#1

Hello.

I've recently moved to a VPS Debian 6. I installed the proper Blueg's plugin for a debian server.

When i am using a command which checks and echos a player's ban details, the server crashes. This did not happen with volt-host and the other plugin volt-host provided me with. ( i did not edit the script)

The thing that crashes the server is mysql_get_field (it crashes the server)

Interesting thing is that the field "Banner" doesn't crash the server but all others do.

Code:
IRCCMD:banned(botid, channel[], user[], host[], params[])
{

new name[100],msg[300];
if(sscanf(params, "s", name))  return 0;

                format(Query, sizeof(Query), "SELECT `banner`,`reason`,`banlength`,`bandate` FROM `bans` WHERE  `name` = '%s'  LIMIT 1 ", name);

			    mysql_query(Query);
                mysql_store_result();
                if (mysql_num_rows() == 0) return IRC_GroupSay(gGroupID,IRC_ADMIN,"1 Sorry, This user is not found in bans list.");
                new banner[30],reason[50],bandate[30],index, line[50],buffer[149],banl[30],result[200];



                mysql_retrieve_row();  <---- DOESNT CRASH IT

                mysql_get_field("banner", banner);  <---- DOESNT CRASH IT
               
                mysql_get_field("reason", reason); <---- crashes it
               
                mysql_get_field("banlength", banl); <----- Crashes it
                
                mysql_get_field("bandate", bandate);  <---  crashes it
              


/// REST OF THE CODE NOW SHOWN (doesnt crash it anyway)

return 1;
}
Reply
#2

pawn Code:
mysql_get_field("reason", reason);
Is the "reason" longer than 50 characters in length?
Reply
#3

nope, the reason is "poop" also i increased all the strings. still crashes.
Reply
#4

No errors in the mysql_log.txt file either?
Reply
#5

nope, no errors. just crashes.
Reply
#6

Do you have IRC Logs?
Reply
#7

there is no need for irc logs
Reply
#8

Quote:
Originally Posted by blazee14
View Post
Do you have IRC Logs?
The issue is with MySQL here, not with IRC.

---

Try using sscanf to retrieve the information. I'll give you an example if you are sure how:

pawn Code:
new szResult[2500];
mysql_store_result();
while(mysql_fetch_row_format(szResult, "|"))
{
    sscanf("p<|>s[25]s[129]iiii", pInfo[extraid][pUsername], pInfo[extraid][pPassword], pInfo[extraid][pAdmin], pInfo[extraid][pScore], pInfo[extraid][pKills], pInfo[extraid][pDeaths]);
    mysql_free_result();
}
Something like that. Notice how the "s's" and "i's" in the sscanf line correspond with the type of variable they are being saved into.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)