reviewd your commits on MDB

From: Date: Mon, 24 Nov 2003 23:06:15 +0000
Subject: reviewd your commits on MDB
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23844@lists.php.net to get a copy of this message
Hi Frank, I reviews your commits in order to port them to MDB 2.x I have one question plus a few minor fixes I did to my local copy which you may want to review if you find the time. 1) question I am not sure if the handling of the port is really correct: $this->connection = @$function( $port > 0 ? $port : $this->host, $this->user, $this->password); 2) the fixes I made you will find in the attached txt file After I made the diff I noticed that my diff is not a unified diff. Also I included simple whitespace fixes as well. If this is a problem I can create a new diff. Just give a whistle! Regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

RCS file: /repository/pear/MDB/MDB/fbsql.php,v retrieving revision 1.16.4.6 diff -r1.16.4.6 fbsql.php 197,199d196 < if (MDB::isError($result)) { < return($result); < } 202,204c199,201 < if (MDB::isError($result)) { < return($result); < } --- > } > if (MDB::isError($result)) { > return($result); 296,297d292 < $this->fixed_float = 30; < 326d320 < $this->selected_database = $this->database_name; 511,516c505,511 < if (intval($field) != $field) { < $field = strtoupper($field); < } < else { < $field = intval($field); < } --- > if (intval($field) != $field) { > $field = strtoupper($field); > } > else > { > $field = intval($field); > } 583,587c578,581 < if ($value[0] == '+') { < return (substr($value, 1)); < } < else { < return($value); --- > if ($value[0] == '+') { > return (substr($value, 1)); > } else { > return($value); 916,923d909 < if (isset($this->options['fixedfloat'])) { < $this->fixed_float = $this->options['fixedfloat']; < } else { < if ($this->connection == 0) { < // XXX needs more checking < $this->connect(); < } < } 925,926d910 < // ($this->fixed_float ? < // '('.($this->fixed_float + 2).','.$this->fixed_float.')' : ''). RCS file: /repository/pear/MDB/MDB/Modules/Manager/fbsql.php,v retrieving revision 1.7.4.2 diff -r1.7.4.2 fbsql.php 104,110d103 < fbsql_stop_db($name, $db->connection); < fbsql_drop_db($name, $db->connection); < fbsql_close($db->connection); < $db->connection = 0; < $db->affected_rows = -1; < return(MDB_OK); < 117c110 < return(MDB_OK); --- > return($db->disconnect()); RCS file: /repository/pear/MDB/MDB/mssql.php,v retrieving revision 1.6.4.10 diff -r1.6.4.10 mssql.php 202,204d201 < if (MDB::isError($result)) { < return($result); < } 207,209c204,206 < if (MDB::isError($result)) { < return($result); < } --- > } > if (MDB::isError($result)) { > return($result); 377,378c374,377 < if(!function_exists("mssql_connect")) { < return($this->raiseError("Query: Microsoft SQL server support is not available in this PHP configuration")); --- > if(!PEAR::loadExtension($this->phptype)) { > return(PEAR::raiseError(NULL, MDB_ERROR_NOT_FOUND, > NULL, NULL, 'extension '.$this->phptype.' is not compiled into PHP', > 'MDB_Error', TRUE)); 386c385 < $this->mssqlRaiseError("Query: Could not query a Microsoft SQL server"); --- > return($this->mssqlRaiseError("Query: Could not query a Microsoft SQL server")); 422c421 < $fetch = $first + $limit; --- > $fetch = $first + $limit; 432,433c431,432 < return($this->mssqlRaiseError()); < } --- > return($this->mssqlRaiseError()); > } 440,442c439,441 < if($first > 0 || $limit > 0) { < $this->limits[$result] = array($first, $limit); < } --- > if($first > 0 || $limit > 0) { > $this->limits[$result] = array($first, $limit); > } 448c447,448 < if (MDB::isError($err = $this->setResultTypes($result, $types))) { --- > $err = $this->setResultTypes($result, $types); > if (MDB::isError($err)) { 551c551 < if (isset($this->limits[$result])) { --- > if (isset($this->limits[$result])) { 553c553 < } --- > } 645,646c645,646 < $rows = mssql_num_rows($result); < if (isset($this->limits[$result])) { --- > $rows = mssql_num_rows($result); > if (isset($this->limits[$result])) { 649c649 < } --- > } 1018c1018 < $value="'"; --- > $value="'"; 1022c1022 < } --- > } 1164c1164 < // Since we are create the sequence on demand --- > // Since we are creating the sequence on demand 1176,1184c1176,1184 < $res = mssql_query("select @@IDENTITY as 'Identity'", $this->connection); < if (!$res) { < return MDB_ERROR; < } < $row = mssql_fetch_row($res); < return $row[0]; < $res = $this->query("DELETE FROM $sequence_name WHERE sequence < $value"); < if (MDB::isError($res)) { < $this->warnings[] = 'Next ID: could not delete previous sequence table values'; --- > $result = $this->query("SELECT @@IDENTITY FROM $sequence_name", 'integer'); > if (MDB::isError($result)) { > return($result); > } > $value = $this->fetch($result); > $this->freeResult($result); > $result = $this->query("DELETE FROM $sequence_name WHERE sequence < $value"); > if (MDB::isError($result)) { > $this->warnings[] = 'nextID: could not delete previous sequence table values'; 1227c1227 < if (isset($this->limits[$result])) { --- > if (isset($this->limits[$result])) { 1229c1229 < } --- > }
« previous php.pear.dev (#23844) next »