Help with MySQL error

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
SQL ERROR [ mysql4 ]

Out of range value adjusted for column 'poll_length' at row 1 [1264]

SQL

I'm getting this error in phpbb when trying to reply to a topic with a poll. I don't know what is wrong, but I read somewhere that it is because MySQL is running in strict mode or something like that. Has anyone got any ideas??


UPDATE phpbb3_topics SET forum_id = 82, icon_id = 0, topic_approved = '1', topic_title = 'Points Shop', topic_first_poster_name = 'Administrator', topic_type = 2, topic_time_limit = 0, poll_title = 'Do You Think It Is Worth Reinstalling The Points Shop?', poll_start = '1262458004', poll_max_options = '1', poll_length = 52254720000, poll_vote_change = '0', topic_last_view_time = 1262630384, topic_attachment = 0 WHERE topic_id = 188

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: includes/functions_posting.php
LINE: 2198
CALL: dbal_mysql->sql_query()

FILE: posting.php
LINE: 1346
CALL: submit_post()
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Presumably, `poll_length`has type INT. The maximum size of an INT is 2147483647 (signed) and 4294967295 (unsigned). Setting poll_length to 52254720000 is the problem (it's out of the range of valid INTs).

52254720000 seconds is 86400 weeks (52254720000 / (60*60*24*7); 86400 also happens to be the number of seconds in a day). What's probably happened somewhere is that a quantity representing days was wrongly converted to seconds twice (i.e. twice multiplied by 86400). Find the plugin, fix the code, submit a patch.
 
Last edited:

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
I've fixed it now.

One of the mods I installed managed to add an extra set of quotes into a file, which was messing things up.
 
Top