From 7244b4500e2b685cee5e9c4746a87f12acb56297 Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 12 Mar 2010 08:13:59 +0000 Subject: - Merge changes from MDB2's trunk --- program/lib/MDB2/Driver/Datatype/mysql.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'program/lib/MDB2/Driver/Datatype/mysql.php') diff --git a/program/lib/MDB2/Driver/Datatype/mysql.php b/program/lib/MDB2/Driver/Datatype/mysql.php index ac7bcd316..055e01067 100644 --- a/program/lib/MDB2/Driver/Datatype/mysql.php +++ b/program/lib/MDB2/Driver/Datatype/mysql.php @@ -43,7 +43,7 @@ // | Author: Lukas Smith | // +----------------------------------------------------------------------+ // -// $Id: mysql.php 292715 2009-12-28 14:06:34Z quipo $ +// $Id: mysql.php 295587 2010-02-28 17:16:38Z quipo $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -116,7 +116,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common */ function getTypeDeclaration($field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -219,7 +219,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common */ function _getIntegerDeclaration($name, $field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -236,6 +236,9 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common $notnull = empty($field['notnull']) ? '' : ' NOT NULL'; $unsigned = empty($field['unsigned']) ? '' : ' UNSIGNED'; + if (empty($default) && empty($notnull)) { + $default = ' DEFAULT NULL'; + } $name = $db->quoteIdentifier($name, true); return $name.' '.$this->getTypeDeclaration($field).$unsigned.$default.$notnull.$autoinc; } @@ -308,7 +311,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common */ function _getDecimalDeclaration($name, $field) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -346,7 +349,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common */ function matchPattern($pattern, $operator = null, $field = null) { - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -537,7 +540,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common $length = null; break; default: - $db =& $this->getDBInstance(); + $db = $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } -- cgit v1.2.3