MySQL Forums
Forum List  »  Other Migration

Default value for INT field: MySQL 4.0/5.0 different?
Posted by: Jack Levy
Date: January 25, 2006 10:00AM

MySQL 4.0 accepts the following and turns the empty string into a zero value:

CREATE TABLE `tab1` (`col1` int(6) NOT NULL DEFAULT '');

But MySQL 5.0 insists on a numeric value for the default, otherwise it says:

ERROR 1067 (42000): Invalid default value for 'col1'

The application creating the query is third-party and can't be changed. I've tried playing with the SQL mode setting, but can't make MySQL 5.0 server less fussy. This is breaking a Master/Slave setup, with the 5.0 slave stopping replication when it hits that error.

Any suggestions?

Options: ReplyQuote


Subject
Views
Written By
Posted
Default value for INT field: MySQL 4.0/5.0 different?
13405
January 25, 2006 10:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.