cvs: pear /MDB2/MDB2/Driver/Datatype Common.php mssql.php

From: Date: Thu, 01 Mar 2007 14:59:36 +0000
Subject: cvs: pear /MDB2/MDB2/Driver/Datatype Common.php mssql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44925@lists.php.net to get a copy of this message
quipo Thu Mar 1 14:59:36 2007 UTC Modified files: /pear/MDB2/MDB2/Driver/Datatype Common.php mssql.php Log: - missing call to $this->getDBInstance(); - propagate errors http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/Common.php?r1=1.120&r2=1.121&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/Common.php diff -u pear/MDB2/MDB2/Driver/Datatype/Common.php:1.120 pear/MDB2/MDB2/Driver/Datatype/Common.php:1.121 --- pear/MDB2/MDB2/Driver/Datatype/Common.php:1.120 Thu Mar 1 14:12:52 2007 +++ pear/MDB2/MDB2/Driver/Datatype/Common.php Thu Mar 1 14:59:36 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.120 2007/03/01 14:12:52 quipo Exp $ +// $Id: Common.php,v 1.121 2007/03/01 14:59:36 quipo Exp $ require_once 'MDB2/LOB.php'; @@ -444,7 +444,7 @@ * collation * Text value with the default COLLATION for this field. * @return string DBMS specific SQL code portion that should be used to - * declare the specified field. + * declare the specified field, or a MDB2_Error on failure * @access protected */ function _getDeclaration($name, $field) @@ -456,6 +456,9 @@ $name = $db->quoteIdentifier($name, true); $declaration_options = $db->datatype->_getDeclarationOptions($field); + if (PEAR::isError($declaration_options)) { + return $declaration_options; + } return $name.' '.$this->getTypeDeclaration($field).$declaration_options; } @@ -493,6 +496,10 @@ $default = ''; if (array_key_exists('default', $field)) { if ($field['default'] === '') { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } $field['default'] = empty($field['notnull']) ? null : $this->valid_default_values[$field['type']]; if ($field['default'] === '' http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/mssql.php?r1=1.51&r2=1.52&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/mssql.php diff -u pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.51 pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.52 --- pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.51 Thu Mar 1 14:22:01 2007 +++ pear/MDB2/MDB2/Driver/Datatype/mssql.php Thu Mar 1 14:59:36 2007 @@ -3,7 +3,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -40,11 +40,11 @@ // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | // | POSSIBILITY OF SUCH DAMAGE. | // +----------------------------------------------------------------------+ -// | Authors: Lukas Smith <smith@pooteeweet.org> | +// | Authors: Lukas Smith <smith@pooteeweet.org> | // | Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.51 2007/03/01 14:22:01 quipo Exp $ +// $Id: mssql.php,v 1.52 2007/03/01 14:59:36 quipo Exp $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -166,7 +166,7 @@ return ''; } - // }}} + // }}} // {{{ _getDeclaration() /** @@ -201,6 +201,10 @@ $default = ''; if (array_key_exists('default', $field)) { if ($field['default'] === '') { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } $field['default'] = empty($field['notnull']) ? null : $this->valid_default_values[$field['type']]; if ($field['default'] === ''

« previous php.pear.cvs (#44925) next »