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

From: Date: Sun, 20 Feb 2005 17:44:20 +0000
Subject: cvs: pear /MDB2/MDB2/Driver/Datatype Common.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-29543@lists.php.net to get a copy of this message
lsmith Sun Feb 20 12:44:20 2005 EDT Modified files: /pear/MDB2/MDB2/Driver/Datatype Common.php Log: - fixed a bug convertResultRow() when handling integer and text values that are NULL http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Datatype/Common.php?r1=1.19&r2=1.20&ty=u Index: pear/MDB2/MDB2/Driver/Datatype/Common.php diff -u pear/MDB2/MDB2/Driver/Datatype/Common.php:1.19 pear/MDB2/MDB2/Driver/Datatype/Common.php:1.20 --- pear/MDB2/MDB2/Driver/Datatype/Common.php:1.19 Sun Jan 2 16:44:24 2005 +++ pear/MDB2/MDB2/Driver/Datatype/Common.php Sun Feb 20 12:44:20 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.19 2005/01/02 21:44:24 lsmith Exp $ +// $Id: Common.php,v 1.20 2005/02/20 17:44:20 lsmith Exp $ /** * @package MDB2 @@ -223,21 +223,11 @@ ) { continue; } - $type = $types[$current_column]; - switch ($type) { - case 'text': - break; - case 'integer': - $row[$key] = intval($row[$key]); - break; - default: - $value = $this->convertResult($row[$key], $type); - if (MDB2::isError($value)) { - return $value; - } - $row[$key] = $value; - break; + $value = $this->convertResult($row[$key], $types[$current_column]); + if (MDB2::isError($value)) { + return $value; } + $row[$key] = $value; } } return $row; @@ -706,6 +696,7 @@ } $value = @fopen($value, 'r'); } + if (is_resource($value)) { $fp = $value; $value = ''; @@ -716,6 +707,7 @@ @fclose($fp); } } + return $value; } @@ -1061,14 +1053,12 @@ case 'resultlob': $class_name = 'MDB2_LOB_Result'; break; - case 'inputfile': - $class_name = 'MDB2_LOB_Input_File'; - break; case 'outputfile': $class_name = 'MDB2_LOB_Output_File'; break; default: - return $db->raiseError('createLOB: '.$arguments['type'] . ' is not a valid type of large object'); + return $db->raiseError('createLOB: '.$arguments['type'] + . ' is not a valid type of large object'); } } else { if (isset($arguments['class'])) {

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