First, I use MySQL from version 5.1. up to 5.6 and HeidiSQL revision 4775. Also found this behaviour couple revisions back.
To replicate behaviour, create sandbox database and test table like this:
CREATE DATABASE `sandbox`;
USE `sandbox`;
CREATE TABLE `test_timestamp_update` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`title` VARCHAR(50) NULL DEFAULT NULL COMMENT 'title' COLLATE 'utf8_czech_ci',
`dt_upd` TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'title' COLLATE 'utf8_czech_ci',
PRIMARY KEY (`id`)
)
COMMENT='Test timestamp update'
COLLATE='utf8_czech_ci'
ENGINE=InnoDB;
Now, navigate to this new table and first look at column description and then CREATE code. At both screens, there is no ON UPDATE CURRENT_TIMESTAMP and even given COMMENT.
But, run this SQL:
SHOW CREATE TABLE `sandbox`.`test_timestamp_update`;
There is UPDATE part and COMMENT too. I think HeidiSQL just somehow trim this information because if I do this, UPDATE timestamp works:
INSERT INTO `sandbox`.`test_timestamp_update` (`title`) VALUES ('test title');
SELECT * FROM `sandbox`.`test_timestamp_update`;
UPDATE `sandbox`.`test_timestamp_update` SET `title` = 'test title updated' WHERE `id` = 1;
SELECT * FROM `sandbox`.`test_timestamp_update`;
It's not critical, but I've found this being little bit annoying. :)
Can anyone else confirm this?
Regards
Michal