MyBB Community Forums

Full Version: [F] MySQL default value problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
While trying to confirm the bug mentioned here, I came across the following db problem in trying to copy the thread:

Quote:SQL Error:
1364 - Field 'message' doesn't have a default value
Query:
INSERT INTO mybb_posts (tid,fid,subject,icon,uid,username,dateline,ipaddress,includesig,smilieoff,edituid,edittime,visible) VALUES ('2','3','another forum','0','1','Eljay','1214842957','127.0.0.1','0','0','0','0','1')

This is a general problem throughout the board anywhere where the field name is left out of insert queries and the database tries to use a default value, when the field doesn't have one set. e.g. creating new forums.

Just reinstalled my local testing server setup from scratch so it could be something I haven't set up yet.. Toungue
(2008-06-30, 04:54 PM)leejeffery Wrote: [ -> ]While trying to confirm the bug mentioned here, I came across the following db problem in trying to copy the thread:

Quote:SQL Error:
1364 - Field 'message' doesn't have a default value
Query:
INSERT INTO mybb_posts (tid,fid,subject,icon,uid,username,dateline,ipaddress,includesig,smilieoff,edituid,edittime,visible) VALUES ('2','3','another forum','0','1','Eljay','1214842957','127.0.0.1','0','0','0','0','1')

This is a general problem throughout the board anywhere where the field name is left out of insert queries and the database tries to use a default value, when the field doesn't have one set. e.g. creating new forums.

Just reinstalled my local testing server setup from scratch so it could be something I haven't set up yet.. Toungue

Turn off MySQL Strict
Ok that fixes the problems, but it seems to me like it should work with strict mode on, especially seeing as it's "recommended" during install.

Ah well, at least I can get on with testing properly now Toungue
The problem is MySQL doesn't allow default values for "text" fields and then they force you to set it to an empty string which is quite counter-productive and counter-intuitive. They really need to change that on their end.
I've fixed your particular error and I now run my localhost in MySQL Strict mode. Post a new bug report if you find anymore.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.