cvs: pear /MDB2/MDB2 Extended.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php

From: Date: Fri, 19 Aug 2005 06:42:19 +0000
Subject: cvs: pear /MDB2/MDB2 Extended.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-34158@lists.php.net to get a copy of this message
lsmith Fri Aug 19 02:42:19 2005 EDT Modified files: /pear/MDB2/MDB2 Extended.php /pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php Log: - return by ref fixes - cosmetic fixes

http://cvs.php.net/diff.php/pear/MDB2/MDB2/Extended.php?r1=1.27&r2=1.28&ty=u Index: pear/MDB2/MDB2/Extended.php diff -u pear/MDB2/MDB2/Extended.php:1.27 pear/MDB2/MDB2/Extended.php:1.28 --- pear/MDB2/MDB2/Extended.php:1.27 Sun Aug 14 05:05:36 2005 +++ pear/MDB2/MDB2/Extended.php Fri Aug 19 02:42:16 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: Extended.php,v 1.27 2005/08/14 09:05:36 lsmith Exp $ +// $Id: Extended.php,v 1.28 2005/08/19 06:42:16 lsmith Exp $ /** * @package MDB2 @@ -203,7 +203,8 @@ if (PEAR::isError($result)) { return $result; } - return $db->query($query, $types, $result_class); + $result =& $db->query($query, $types, $result_class); + return $result; } // {{{ http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.67&r2=1.68&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.67 pear/MDB2/MDB2/Driver/fbsql.php:1.68 --- pear/MDB2/MDB2/Driver/fbsql.php:1.67 Sun Aug 14 05:05:36 2005 +++ pear/MDB2/MDB2/Driver/fbsql.php Fri Aug 19 02:42:16 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.67 2005/08/14 09:05:36 lsmith Exp $ +// $Id: fbsql.php,v 1.68 2005/08/19 06:42:16 lsmith Exp $ // /** @@ -314,9 +314,9 @@ } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -493,8 +493,9 @@ } if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.97&r2=1.98&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.97 pear/MDB2/MDB2/Driver/ibase.php:1.98 --- pear/MDB2/MDB2/Driver/ibase.php:1.97 Tue Jun 28 05:57:55 2005 +++ pear/MDB2/MDB2/Driver/ibase.php Fri Aug 19 02:42:16 2005 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.97 2005/06/28 09:57:55 quipo Exp $ +// $Id: ibase.php,v 1.98 2005/08/19 06:42:16 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -437,9 +437,9 @@ if ($this->in_transaction) { $connection = $this->transaction_id; } else { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -521,8 +521,9 @@ } if (is_int($quote = strpos($query, "'", $position)) && $quote < $p_position) { if (!is_int($end_quote = strpos($query, "'", $quote + 1))) { - return $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, 'prepare: query with an unterminated text string specified'); + return $err; } switch ($this->escape_quotes) { case '': @@ -551,8 +552,9 @@ } $name = preg_replace('/^.{'.($position+1).'}([a-z0-9_]+).*$/i', '\\1', $query); if ($name === '') { - return $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, 'prepare: named parameter with an empty name'); + return $err; } $query = substr_replace($query, '?', $position, strlen($name)+1); $position = $p_position + 1; @@ -714,8 +716,9 @@ } if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null; @@ -906,8 +909,9 @@ return $null; } if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } if (!is_null($rownum)) { $seek = $this->seek($rownum); @@ -1055,7 +1059,12 @@ $this->db->last_query = $this->query; $this->db->debug($this->query, 'execute'); if ($this->db->getOption('disable_query')) { - return $isManip ? MDB2_OK : null; + if ($isManip) { + $return = MDB2_OK; + return $return; + } + $null = null; + return $null; } $connected = $this->db->connect(); @@ -1077,15 +1086,21 @@ $result = call_user_func_array('ibase_execute', $parameters); if ($result === false) { - return $this->db->raiseError(); + $err =& $this->db->raiseError(); + return $err; } if ($isManip) { - return (function_exists('ibase_affected_rows') ? ibase_affected_rows($connection) : 0); + if (function_exists('ibase_affected_rows')) { + return ibase_affected_rows($connection); + } else { + return 0; + } } - return $this->db->_wrapResult($result, $this->types, + $result =& $this->db->_wrapResult($result, $this->types, $result_class, $result_wrap_class, $this->row_limit, $this->row_offset); + return $result; } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.74&r2=1.75&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.74 pear/MDB2/MDB2/Driver/mssql.php:1.75 --- pear/MDB2/MDB2/Driver/mssql.php:1.74 Sun Aug 14 03:51:22 2005 +++ pear/MDB2/MDB2/Driver/mssql.php Fri Aug 19 02:42:17 2005 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.74 2005/08/14 07:51:22 lsmith Exp $ +// $Id: mssql.php,v 1.75 2005/08/19 06:42:17 lsmith Exp $ // /** @@ -339,9 +339,9 @@ } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -525,8 +525,9 @@ } if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.69&r2=1.70&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.69 pear/MDB2/MDB2/Driver/mysql.php:1.70 --- pear/MDB2/MDB2/Driver/mysql.php:1.69 Sun Aug 14 05:05:36 2005 +++ pear/MDB2/MDB2/Driver/mysql.php Fri Aug 19 02:42:17 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.69 2005/08/14 09:05:36 lsmith Exp $ +// $Id: mysql.php,v 1.70 2005/08/19 06:42:17 lsmith Exp $ // /** @@ -431,15 +431,17 @@ $this->debug($query, 'query'); if ($this->options['disable_query']) { if ($isManip) { - return MDB2_OK; + $return = MDB2_OK; + return $return; } - return null; + $null = null; + return $null; } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -757,8 +759,9 @@ if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.33&r2=1.34&ty=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.33 pear/MDB2/MDB2/Driver/mysqli.php:1.34 --- pear/MDB2/MDB2/Driver/mysqli.php:1.33 Sun Aug 14 05:05:37 2005 +++ pear/MDB2/MDB2/Driver/mysqli.php Fri Aug 19 02:42:17 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.33 2005/08/14 09:05:37 lsmith Exp $ +// $Id: mysqli.php,v 1.34 2005/08/19 06:42:17 lsmith Exp $ // /** @@ -435,9 +435,9 @@ } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -542,8 +542,9 @@ } if (is_int($quote = strpos($query, "'", $position)) && $quote < $p_position) { if (!is_int($end_quote = strpos($query, "'", $quote + 1))) { - return $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, 'prepare: query with an unterminated text string specified'); + return $err; } switch ($this->escape_quotes) { case '': @@ -572,8 +573,9 @@ } $name = preg_replace('/^.{'.($position+1).'}([a-z0-9_]+).*$/i', '\\1', $query); if ($name === '') { - return $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, 'prepare: named parameter with an empty name'); + return $err; } $query = substr_replace($query, '?', $position, strlen($name)+1); $position = $p_position + 1; @@ -843,8 +845,9 @@ if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null; @@ -1030,7 +1033,12 @@ $this->db->last_query = $this->query; $this->db->debug($this->query, 'execute'); if ($this->db->getOption('disable_query')) { - return $isManip ? MDB2_OK : null; + if ($isManip) { + $return = MDB2_OK; + return $return; + } + $null = null; + return $null; } $connected = $this->db->connect(); @@ -1081,24 +1089,28 @@ } $result = @call_user_func_array('mysqli_stmt_bind_param', $parameters); if ($result === false) { - return $this->db->raiseError(); + $err =& $this->db->raiseError(); + return $err; } } if (!@mysqli_stmt_execute($this->statement)) { - return $this->db->raiseError(); + $err =& $this->db->raiseError(); + return $err; } if (!mysqli_stmt_result_metadata($this->statement)) { - return @mysqli_stmt_affected_rows($this->statement); + $result = @mysqli_stmt_affected_rows($this->statement); + return $result; } if ($this->db->options['result_buffering']) { mysqli_stmt_store_result($this->statement); } - return $this->db->_wrapResult($result, $this->types, + $result &= $this->db->_wrapResult($result, $this->types, $result_class, $result_wrap_class); + return $result; } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.82&r2=1.83&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.82 pear/MDB2/MDB2/Driver/oci8.php:1.83 --- pear/MDB2/MDB2/Driver/oci8.php:1.82 Sun Aug 14 05:05:37 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Fri Aug 19 02:42:17 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.82 2005/08/14 09:05:37 lsmith Exp $ +// $Id: oci8.php,v 1.83 2005/08/19 06:42:17 lsmith Exp $ /** * MDB2 OCI8 driver @@ -316,17 +316,17 @@ $this->dbsyntax = $this->dsn['dbsyntax'] ? $this->dsn['dbsyntax'] : $this->phptype; $query = "ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'"; - $error = $this->_doQuery($query, true); - if (PEAR::isError($error)) { + $err = $this->_doQuery($query, true); + if (PEAR::isError($err)) { $this->disconnect(false); - return $error; + return $err; } $query = "ALTER SESSION SET NLS_NUMERIC_CHARACTERS='. '"; - $error = $this->_doQuery($query, true); - if (PEAR::isError($error)) { + $err = $this->_doQuery($query, true); + if (PEAR::isError($err)) { $this->disconnect(false); - return $error; + return $err; } return MDB2_OK; @@ -446,9 +446,9 @@ } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -532,9 +532,9 @@ } if (is_int($quote = strpos($query, "'", $position)) && $quote < $p_position) { if (!is_int($end_quote = strpos($query, "'", $quote + 1))) { - $error =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, 'prepare: query with an unterminated text string specified'); - return $error; + return $err; } switch ($this->escape_quotes) { case '': @@ -565,9 +565,9 @@ if ($placeholder_type == ':') { $parameter = preg_replace('/^.{'.($position+1).'}([a-z0-9_]+).*$/i', '\\1', $query); if ($parameter === '') { - $error =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, 'prepare: named parameter with an empty name'); - return $error; + return $err; } $length = strlen($parameter)+1; } else { @@ -597,9 +597,9 @@ } $statement = @OCIParse($this->connection, $query); if (!$statement) { - $error =& $this->raiseError(MDB2_ERROR, null, null, + $err =& $this->raiseError(MDB2_ERROR, null, null, 'Could not create statement'); - return $error; + return $err; } $class_name = 'MDB2_Statement_'.$this->phptype; @@ -725,9 +725,9 @@ } if (!$row) { if (is_null($this->result)) { - $error =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); - return $error; + return $err; } $null = null; return $null; @@ -896,9 +896,9 @@ function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null) { if (is_null($this->result)) { - $error =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); - return $error; + return $err; } if (!is_null($rownum)) { $seek = $this->seek($rownum); @@ -1045,7 +1045,6 @@ } $null = null; return $null; - } $connected = $this->db->connect(); @@ -1101,8 +1100,8 @@ if (!PEAR::isError($result)) { $mode = (!empty($lobs) || $this->db->in_transaction) ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS; if (!@OCIExecute($this->statement, $mode)) { - $error =& $this->db->raiseError($this->statement); - return $error; + $err =& $this->db->raiseError($this->statement); + return $err; } if (!empty($lobs)) { http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.68&r2=1.69&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.68 pear/MDB2/MDB2/Driver/pgsql.php:1.69 --- pear/MDB2/MDB2/Driver/pgsql.php:1.68 Wed Jul 6 14:56:24 2005 +++ pear/MDB2/MDB2/Driver/pgsql.php Fri Aug 19 02:42:18 2005 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.68 2005/07/06 18:56:24 lsmith Exp $ +// $Id: pgsql.php,v 1.69 2005/08/19 06:42:18 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -402,8 +402,9 @@ { $connection = $this->_doConnect('template1', false); if (PEAR::isError($connection)) { - return $this->raiseError(MDB2_ERROR_CONNECT_FAILED, null, null, + $err =& $this->raiseError(MDB2_ERROR_CONNECT_FAILED, null, null, 'Cannot connect to template1'); + return $err; } $isManip = MDB2::isManip($query); @@ -422,7 +423,8 @@ return $result; } - return $this->_wrapResult($result, $types, true, false, $limit, $offset); + $result =& $this->_wrapResult($result, $types, true, false, $limit, $offset); + return $result; } // }}} @@ -449,9 +451,9 @@ } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -587,8 +589,9 @@ } if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.38&r2=1.39&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.38 pear/MDB2/MDB2/Driver/querysim.php:1.39 --- pear/MDB2/MDB2/Driver/querysim.php:1.38 Tue Jun 28 06:05:53 2005 +++ pear/MDB2/MDB2/Driver/querysim.php Fri Aug 19 02:42:18 2005 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.38 2005/06/28 10:05:53 quipo Exp $ +// $Id: querysim.php,v 1.39 2005/08/19 06:42:18 lsmith Exp $ // /* @@ -515,8 +515,9 @@ function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } if (!is_null($rownum)) { $seek = $this->seek($rownum); http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.70&r2=1.71&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.70 pear/MDB2/MDB2/Driver/sqlite.php:1.71 --- pear/MDB2/MDB2/Driver/sqlite.php:1.70 Sun Aug 14 05:05:37 2005 +++ pear/MDB2/MDB2/Driver/sqlite.php Fri Aug 19 02:42:18 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.70 2005/08/14 09:05:37 lsmith Exp $ +// $Id: sqlite.php,v 1.71 2005/08/19 06:42:18 lsmith Exp $ // /** @@ -367,9 +367,9 @@ } if (is_null($connection)) { - $error = $this->connect(); - if (PEAR::isError($error)) { - return $error; + $err = $this->connect(); + if (PEAR::isError($err)) { + return $err; } $connection = $this->connection; } @@ -650,8 +650,9 @@ } if (!$row) { if (is_null($this->result)) { - return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, + $err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); + return $err; } $null = null; return $null;
« previous php.pear.cvs (#34158) next »