Bug #37190 | It is not possible to define a NULL timestamp column | ||
---|---|---|---|
Submitted: | 4 Jun 2008 10:54 | Modified: | 5 Jun 2008 8:03 |
Reporter: | Daniel Haas | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Workbench | Severity: | S3 (Non-critical) |
Version: | 5.0.22 | OS: | Windows (Vista) |
Assigned to: | CPU Architecture: | Any |
[4 Jun 2008 10:54]
Daniel Haas
[4 Jun 2008 16:46]
Valeriy Kravchuk
Just do not check NN checkbox for TIMESTAMP column and you'll get something like (I had exported CREATE script from 5.0.22): SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; USE `mydb`; -- ----------------------------------------------------- -- Table `mydb`.`table1` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`table1` ( `idtable1` INT NOT NULL , `c1` VARCHAR(45) NULL , `c2` TIMESTAMP NULL , PRIMARY KEY (`idtable1`) ) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; So, what is the problem?
[5 Jun 2008 8:03]
Daniel Haas
Ah, so I think the problem is that I did not understand that not clicking the NN column adds an explicit NULL to the table definition. Sorry I must have overlooked that. :-)