From 7244b4500e2b685cee5e9c4746a87f12acb56297 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Fri, 12 Mar 2010 03:13:59 -0500 Subject: [PATCH] - Merge changes from MDB2's trunk --- 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 2a0bbb7..f036886 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 @@ */ function getTypeDeclaration($field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -198,7 +198,7 @@ */ function _getIntegerDeclaration($name, $field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -219,6 +219,9 @@ } $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 @@ */ function _quoteCLOB($value, $quote, $escape_wildcards) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -271,7 +274,7 @@ if (!$quote) { return $value; } - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -333,7 +336,7 @@ */ function matchPattern($pattern, $operator = null, $field = null) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -388,7 +391,7 @@ */ function patternEscapeString() { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -514,7 +517,7 @@ $length = null; break; default: - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -541,7 +544,7 @@ */ function mapPrepareDatatype($type) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } -- Gitblit v1.9.1