MyBB Community Forums

Full Version: Too large of threads lead to threads that lead to mysql errors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Threads that are too large lead to this

SQL Error:
1406 - Data too long for column 'message' at row 1
Query:
INSERT INTO mybb_posts (tid,fid,subject,icon,uid,username,dateline,message,ipaddress,longipaddress,includesig,smilieoff,visible,posthash) VALUES ('9','2','Rainbows','15','5','Train','1247114615','[Image: rainbow.gif][Image: rainbow.gif][Image: rainbow.gif][Image: rainbow.gif]......plus about another 1,000 of these','72.218.40.206','1222256846','1','0','1','bbd6749b954a5ac663a1a85a8071394d')

but it still creates the thread.

so you get this on clicking of the thread

SQL Error:
1366 - Incorrect integer value: '' for column 'firstpost' at row 1
Query:
UPDATE mybb_threads SET firstpost='' WHERE tid='5'
The "message" field in the database table is a "text" field. This has a limit of 65535 bytes (2^16) of data.

99.9% of the time, this should be sufficient enough. If you change the type of the field to mediumtext (2^24) or longtext (2^32) then it should allow you to do this without any errors. Can you confirm if doing this works?
We should do some error handling to make sure its not over that limit?
I successfully managed to send a 150,000 word post on my localhost. A 155,000 worded post seemed to turn my mySQL server away. I managed to post a 200,000 worded post here at MyBB.

I can't even replicate the 1,000 of those - my localhost posts that just fine.

I'm not sure how error handling would go - there doesn't seem to be anything constant to actually check against.
(2009-07-09, 07:58 AM)Tomm M Wrote: [ -> ]The "message" field in the database table is a "text" field. This has a limit of 65536 bytes (2^16) of data.

99.9% of the time, this should be sufficient enough. If you change the type of the field to mediumtext (2^24) or longtext (2^32) then it should allow you to do this without any errors. Can you confirm if doing this works?
2^16 bytes or 64k, which is 65536, not 65535. MyBB should do what IPB 1.3 did in handling longer posts, split posts above a certain numer of character (let's say... 100,000) into two posts.
nah I think it should do what proboards does. There's an option in posting to countdown from the maximim # of characters you can have in post.