Bug #4226 Migration from 4.1.1 to 4.1.2
Submitted: 20 Jun 2004 18:36 Modified: 23 Jun 2004 16:56
Reporter: Jeremy Wong Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.2 OS:Linux (Linux)
Assigned to: Sergei Golubchik CPU Architecture:Any

[20 Jun 2004 18:36] Jeremy Wong
Description:
I migrate from 4.1.1 to 4.1.2. The migration is just a simple copy of the data files.

The problem is on the interpretation of the TIMESTAMP column with the InnoDB engine.

4.1.1
`EntryDatetime` timestamp NOT NULL default '0000-00-00 00:00:00'
4.1.2
`EntryDatetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

The behavior of "default CURRENT_TIMESTAMP" is still acceptable, but it is not for "update CURRENT_TIMESTAMP". It is because I never expect there would be such timestamp update in my original application...

It seems that I need to scan all the relevant code for the problem...

How to repeat:

Step 1: in 4.1.1, create table `t1` ( `c1` timestamp not null ) type=InnoDB;
Step 2: migration from 4.1.1 to 4.1.2, i.e. copy the db files...
Step 3: show create table `t1`;

Suggested fix:
4.1.1
`EntryDatetime` timestamp NOT NULL default '0000-00-00 00:00:00'
4.1.2
`EntryDatetime` timestamp NOT NULL default '0000-00-00 00:00:00'
[21 Jun 2004 9:16] Sergei Golubchik
could you please clarify what the bug is ?

because

   EntryDatetime timestamp NOT NULL default '0000-00-00 00:00:00'

in 4.1.1 is *exactly* the same as

   EntryDatetime timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

in 4.1.2
[22 Jun 2004 5:46] Jeremy Wong
the bug arises in my application when it's migrated from 4.1.1 to 4.1.2.. because the application only expects a default value '0000-00-00 00:00:00' rather than 'current_timestamp'...
[23 Jun 2004 16:56] Sergei Golubchik
sorry, we cannot change it, the new behaviour is correct.

when you insert NULL into the timetsmap column you get CURRENT_TIMESTAMP inserted, not
'0000-00-00 00:00:00'.