Unable to change default value for a timestamp column

[expired user #6645]'s profile image [expired user #6645] posted 12 years ago in General Permalink
Hi all!

using Heidi 7.0.0.4235 I've come to an odd behaviour when setting default value to a timestamp column.

Use this table to check:

CREATE TABLE `TEST_TIMESTAMP` (
`ID` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`first_value` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`fist_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`second_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;


When created, go to "columns" and try to set default values for first_date and second_date to "No Default Value". Click Save. The log below shows :
/* Entering session "Server" */
/* Entering session "Server" */


Close Heidi. Open again and check the table. No change has been made to default values for the aforementioned columns.


kalvaro's profile image kalvaro posted 12 years ago Permalink
Your code has a couple of typos. If I use this:

CREATE TABLE `TEST_TIMESTAMP` (
`ID` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`first_value` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`fist_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`second_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(ID)
) COLLATE='utf8_general_ci' ENGINE=InnoDB;


... I have no problems altering date fields to "No default".

What's your server version? Does it run in traditional SQL mode? Does the table have data?
[expired user #6645]'s profile image [expired user #6645] posted 12 years ago Permalink
I can't. Even with the code you provided. There is no error though. Simply nothing is changed. No warning, no message....nothing.

Server 5.5 enterprise traditional mode
kalvaro's profile image kalvaro posted 12 years ago Permalink
Sorry for the obvious question but... you hit "Save" afterwards, don't you?
[expired user #6645]'s profile image [expired user #6645] posted 12 years ago Permalink
Yep

Please login to leave a reply, or register at first.