cvs: pear /MDB2/MDB2/Driver/Datatype Common.php
| From: | Lorenzo Alberton | Date: | Mon, 05 Mar 2007 15:39:10 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Datatype Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44985@lists.php.net to get a copy of this message | ||
quipo Mon Mar 5 15:39:10 2007 UTC
Modified files:
/pear/MDB2/MDB2/Driver/Datatype Common.php
Log:
fixed bug #10264: Method fails to deal with custom datatype mappings. Patch by Andrew Hill
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/Common.php?r1=1.122&r2=1.123&diff_format=u
Index: pear/MDB2/MDB2/Driver/Datatype/Common.php
diff -u pear/MDB2/MDB2/Driver/Datatype/Common.php:1.122
pear/MDB2/MDB2/Driver/Datatype/Common.php:1.123
--- pear/MDB2/MDB2/Driver/Datatype/Common.php:1.122 Fri Mar 2 19:43:34 2007
+++ pear/MDB2/MDB2/Driver/Datatype/Common.php Mon Mar 5 15:39:10 2007
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.122 2007/03/02 19:43:34 quipo Exp $
+// $Id: Common.php,v 1.123 2007/03/05 15:39:10 quipo Exp $
require_once 'MDB2/LOB.php';
@@ -500,8 +500,12 @@
if (PEAR::isError($db)) {
return $db;
}
- $field['default'] = empty($field['notnull'])
- ? null : $this->valid_default_values[$field['type']];
+ if (empty($field['notnull'])) {
+ $field['default'] = null;
+ } else {
+ $valid_default_values = $this->getValidTypes();
+ $field['default'] = $valid_default_values[$field['type']];
+ }
if ($field['default'] === ''
&& ($db->options['portability'] &
MDB2_PORTABILITY_EMPTY_TO_NULL)
) {