Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 69036
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: SHAW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11008
Fixed in: 0.11013



Subject: MySQL Producer & TIMESTAMP Culumns: No 'NULL' Written When is_nullable = 1
The behavior of MySQL's TIMESTAMP type varies based upon how it is defined and whether it's the first or Nth definition. (see http://dev.mysql.com/doc/refman/5.1/en/timestamp.html). Unlike other MySQL types a TIMESTAMP defaults to NOT NULL. Using 'DEFAULT NULL' is illegal unless the TIMESTAMP column is declared with the NULL attribute. Since the MySQL producer does not write 'NULL' when is_nullable() is true it is impossible to create a NULL TIMESTAMP column. -Skye
It's definitely fixed right now: https://github.com/dbsrgits/sql-translator/blob/master/lib/SQL/Translator/Producer/MySQL.pm (line 617) # Null? if ( $field->is_nullable ) { $field_def .= ' NULL'; } else { $field_def .= ' NOT NULL'; } On Wed Jun 22 16:34:39 2011, SHAW wrote: Show quoted text
> The behavior of MySQL's TIMESTAMP type varies based upon how it is > defined and whether it's the first or Nth definition. > (see http://dev.mysql.com/doc/refman/5.1/en/timestamp.html). > > Unlike other MySQL types a TIMESTAMP defaults to NOT NULL. > > Using 'DEFAULT NULL' is illegal unless the TIMESTAMP column is declared > with the NULL attribute. > > Since the MySQL producer does not write 'NULL' when is_nullable() is true > it is impossible to create a NULL TIMESTAMP column. > > > -Skye >