$_->{'Type'} =~ /^(\w+)\(?([^)]+)?\)?( \d+)?$/
or die "Illegal type: ". $_->{'Type'}. "\n";
my($type, $length) = ($1, $2);
+
+ my $default = $_->{'Default'};
+ $default = '' unless defined($default);
+ $default = \0 if $default eq '0';
+ $default = \'NOW()' if uc($default) eq 'CURRENT_TIMESTAMP';
+
[
$_->{'Field'},
$type,
( $_->{'Null'} =~ /^YES$/i ? 'NULL' : '' ),
$length,
- $_->{'Default'},
+ $default,
$_->{'Extra'}
]
} @{ $sth->fetchall_arrayref( {} ) };