Error Counting Unread Private Messages »  Show posts from    to     

Icy Phoenix


Old Support Topics - Error Counting Unread Private Messages



jefazo666 [ Tue 29 Jan, 2013 00:12 ]
Post subject: Error Counting Unread Private Messages
Hi all, Yesterday, one user reported this error:

Quote:
SQL ERROR [ mysql4 ]

BIGINT UNSIGNED value is out of range in '(`clubtwo3_club205`.`ip_users`.`user_unread_privmsg` - 1)' [1690]

SQL

UPDATE ip_users SET user_unread_privmsg = user_unread_privmsg - 1 WHERE user_id = 1262

BACKTRACE


FILE: includes/db/mysql.php
LINE: 295
CALL: sql_db->sql_error()

FILE: privmsg.php
LINE: 309
CALL: sql_db->sql_query()


I made a research. The user had one unread message, but 0 marked at his ip_user table's record, so when he tries to read it, system fails while trying to make 0 -1 in an unsigned bigint.

I solved this making this record + 1 by myself for this user, and other one with the same problem. By now, only two users reported this problem, and I do not know where can be the error counting this. I was thinking and these weeks I noticed that users are sending two times the request to the server. This is caused because if the user's screen didn't changed fast, they click again the link, and the same action is executed 2 times. I have seen several duplicated messages on the forum. I think something similar could happen here when the same user clicks on an unread message, and the system decreases it but not showed, so the patience less user clicked again, decreasing two times the counter. This could only happend if the user had more than 1 unread private message.

Did someone else saw the same error?


Informpro [ Tue 29 Jan, 2013 12:53 ]
Post subject: Re: Error Counting Unread Private Messages
I one time had the same problem with postcount. Need either to specialcase it in php or in sql.


Mighty Gorgon [ Tue 19 Feb, 2013 23:20 ]
Post subject: Re: Error Counting Unread Private Messages
Very strange... I'll think to a way to fix this.




Powered by Icy Phoenix