So my guess is one, or a combination of the following conditions, are causing your problem:
(1) Your PK fields are defined as
`id` INT(11) NOT NULL DEFAULT '0'
instead of
`id` int(11) NOT NULL
(2) All or some of your tables are MyISAM (non-transactional tables originally intended for data logging applications) when they should be InnoDB (Transactional).
(3) You are not running in "STRICT" SQL mode, which would cause the DEFAULT '0' to get attached automatically in your create table statement (item #1 indirect cause)
Strict SQL mode can be implemented by adding options to /etc/my.cnf config file and restarting
sql-mode = STRICT_ALL_TABLES
This mode eliminates the entire "silent defaults and silent string truncation" behavior that is the stupid default setting, and probably must remain the default setting for backward compatibility.
(4) If an FK (Foreign Key) is getting set to zero and you wish it to be nullable then it should be defined as:
`foreign_id` int(11) DEFAULT NULL
Hope that helps,
-Kieran
On Nov 28, 2011, at 8:15 PM, James Cicenia wrote:
MySQL
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden