Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: tom@eborcom.com (no email address)
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.08
Fixed in: (no value)



Subject: MySQL Producer does not cope with NOW() default value
The MySQL Producer fails to cope with NOW() as a default value. Other producers cope with this, so I've stolen their logic in the small patch attached. Thanks, Tom Hukins
Subject: mysql_now.patch
--- lib/SQL/Translator/Producer/MySQL.pm.was 2007-08-14 16:34:19.000000000 +0100 +++ lib/SQL/Translator/Producer/MySQL.pm 2007-08-14 16:39:04.000000000 +0100 @@ -361,6 +361,8 @@ if ( defined $default ) { if ( uc $default eq 'NULL') { $field_def .= ' DEFAULT NULL'; + } elsif (uc $default eq 'NOW()') { + $field_def .= ' DEFAULT NOW()'; } else { $field_def .= " DEFAULT '$default'"; }
Unfortunately, MySQL doesn't support this either.. unless it's in some magical version I've not come across.. ? Jess On Tue Aug 14 11:44:50 2007, tom@eborcom.com wrote: Show quoted text
> The MySQL Producer fails to cope with NOW() as a default value. Other > producers cope with this, so I've stolen their logic in the small
patch Show quoted text
> attached. > > Thanks, > Tom Hukins
The patch in http://rt.cpan.org/Ticket/Display.html?id=39713 provides a superior, generic solution. -- rjbs
Issue has been since resolved via RT#39713