Bug #19369 Display Default Value wrong for Timestamp fields
Submitted: 26 Apr 2006 10:12 Modified: 5 Jan 2007 10:17
Reporter: Stefan Zingler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.20 OS:Windows (Win XP)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: Object Editors

[26 Apr 2006 10:12] Stefan Zingler
Description:
In the Table editor the Display of a Field with the type TIMESTAMP shows sometimes the correct value of "CURRENT_TIMESTAMP" another time NULL.

If i click in any column of this field the default turns into "NULL".

I using MySQL 4.1.15 and QB 1.1.20.

How to repeat:
Create a Table containing a timestamp field with "default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP".

Go to the "Edit Table dialog" and look at the timestamp column.

Click in any column of this field.

Watch the default value.

Suggested fix:
I have no idea.
[26 Apr 2006 11:37] Valeriy Kravchuk
Thank you for a bug report. Verified just as described. Weird behaviour.
[4 Jan 2007 8:34] Mike Lischke
Stefan, please check with the latest release (1.2.8). All I see is that the default value is cleared when you enable auto_inc, which is correct since you cannot have both auto increment and a default value. In any other case the default value stays at it is.

Note also: the table editor is not able to handle the special case DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP. If you change anything in a timestamp column you will lose the ON UPDATE part. This part is such a weird exception of the general syntax that we haven't yet handled it properly. 

This is a separate issue and must be handled elsewhere. Here we try to fix the problem of clearing the default value as such when any other column in the table editor is clicked.
[4 Jan 2007 10:08] Stefan Zingler
I checked it with Version 1.2.8. Looks good.
Now it works correct. 

Thanks you, good work.
[5 Jan 2007 10:17] Mike Lischke
Stefan, excellent. Thank you.