diff options
author | alecpl <alec@alec.pl> | 2010-03-12 08:13:59 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-03-12 08:13:59 +0000 |
commit | 7244b4500e2b685cee5e9c4746a87f12acb56297 (patch) | |
tree | 7649eb06e5ae60b8de741256add44cd74443d47b /program/lib/MDB2/Driver/Datatype/pgsql.php | |
parent | bc404ffd41c3411510a022ae5b0c9f2bfe8f5db1 (diff) |
- Merge changes from MDB2's trunk
Diffstat (limited to 'program/lib/MDB2/Driver/Datatype/pgsql.php')
-rw-r--r-- | program/lib/MDB2/Driver/Datatype/pgsql.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/program/lib/MDB2/Driver/Datatype/pgsql.php b/program/lib/MDB2/Driver/Datatype/pgsql.php index 2a0bbb717..f036886e3 100644 --- a/program/lib/MDB2/Driver/Datatype/pgsql.php +++ b/program/lib/MDB2/Driver/Datatype/pgsql.php @@ -42,7 +42,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php 292715 2009-12-28 14:06:34Z quipo $ +// $Id: pgsql.php 295587 2010-02-28 17:16:38Z quipo $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -117,7 +117,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common */ function getTypeDeclaration($field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -198,7 +198,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common */ function _getIntegerDeclaration($name, $field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -219,6 +219,9 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common } $notnull = empty($field['notnull']) ? '' : ' NOT NULL'; + if (empty($default) && empty($notnull)) { + $default = ' DEFAULT NULL'; + } $name = $db->quoteIdentifier($name, true); return $name.' '.$this->getTypeDeclaration($field).$default.$notnull; } @@ -239,7 +242,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common */ function _quoteCLOB($value, $quote, $escape_wildcards) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -271,7 +274,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common if (!$quote) { return $value; } - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -333,7 +336,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common */ function matchPattern($pattern, $operator = null, $field = null) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -388,7 +391,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common */ function patternEscapeString() { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -514,7 +517,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common $length = null; break; default: - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -541,7 +544,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common */ function mapPrepareDatatype($type) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } |