Gossamer Forum
Home : Products : Others : MySQLMan :

Re: [brewt] entering a default value of 0 with not null for an int column

Quote Reply
Re: [brewt] entering a default value of 0 with not null for an int column In reply to
Sorry it took so long - it's been a busy week. Here's a patch:
Code:
Index: MySQLMan.pm
===================================================================
RCS file: mysqlman/MySQLMan.pm,v
retrieving revision 1.28
diff -u -r1.28 MySQLMan.pm
--- MySQLMan.pm 10 Jun 2008 03:59:24 -0000 1.28
+++ MySQLMan.pm 25 Apr 2009 03:09:56 -0000
@@ -2942,8 +2942,9 @@
}
$col_spec .= ' ' . $IN->param("attributes_$i") . ' ';
$col_spec .= $IN->param("null_$i") . ' ';
- if ( $IN->param("default_$i") ) {
- $col_spec .= 'DEFAULT ' . $DBH->quote( $IN->param("default_$i") ) . ' ';
+ my $default = $IN->param("default_$i");
+ if (length $default) {
+ $col_spec .= 'DEFAULT ' . $DBH->quote($default) . ' ';
}
$col_spec .= $IN->param("extra_$i");

Adrian
Subject Author Views Date
Thread entering a default value of 0 with not null for an int column chmodphil 13396 Apr 18, 2009, 7:33 AM
Thread Re: [chmodphil] entering a default value of 0 with not null for an int column
brewt 13015 Apr 18, 2009, 3:40 PM
Post Re: [brewt] entering a default value of 0 with not null for an int column
chmodphil 12993 Apr 18, 2009, 4:32 PM
Thread Re: [brewt] entering a default value of 0 with not null for an int column
brewt 12943 Apr 24, 2009, 8:15 PM
Post Re: [brewt] entering a default value of 0 with not null for an int column
chmodphil 12861 May 8, 2009, 6:37 AM