[Rt-commit] r14585 - rt/3.8/trunk/etc/upgrade

ruz at bestpractical.com ruz at bestpractical.com
Mon Jul 28 20:49:25 EDT 2008


Author: ruz
Date: Mon Jul 28 20:49:19 2008
New Revision: 14585

Modified:
   rt/3.8/trunk/etc/upgrade/schema.mysql-4.0-4.1.pl

Log:
* fix issues with NOT NULL DEFAULT NULL in etc/upgrade/schema.mysql-4.0-4.1.pl
  Thanks to Mathieu Longtin for the patch.

Modified: rt/3.8/trunk/etc/upgrade/schema.mysql-4.0-4.1.pl
==============================================================================
--- rt/3.8/trunk/etc/upgrade/schema.mysql-4.0-4.1.pl	(original)
+++ rt/3.8/trunk/etc/upgrade/schema.mysql-4.0-4.1.pl	Mon Jul 28 20:49:19 2008
@@ -340,11 +340,10 @@
     $res .= 'NULL';
     my $default = column_info(@info{qw(TABLE_NAME COLUMN_NAME)})->{default};
     if ( defined $default ) {
-        $default = $dbh->quote($default);
-    } else {
-        $default = 'NULL';
+        $res .= ' DEFAULT '. $dbh->quote($default);
+    } elsif ( $info{'NULLABLE'} ) {
+        $res .= ' DEFAULT NULL';
     }
-    $res .= ' DEFAULT '. $default;
     $res .= ' AUTO_INCREMENT' if $info{'mysql_is_auto_increment'};
     return $res;
 }


More information about the Rt-commit mailing list