Re: [PATCH] DB::oci8::fetchRow() should use fetchInto()
| From: | Roman Neuhauser | Date: | Tue, 10 Jun 2003 18:19:46 +0000 |
| Subject: | Re: [PATCH] DB::oci8::fetchRow() should use fetchInto() | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17275@lists.php.net to get a copy of this message | ||
# cox@idecnet.com / 2003-06-10 18:42:58 +0200:
> As I said in my previous email, oci::fetchRow() should just be dropped. The
> DB_result::fetchRow() calls internally fetchInto(), so this func gets never
> called.
Ok, here's a patch.
--
If you cc me or remove the list(s) completely I'll most likely ignore
your message. see http://www.eyrie.org./~eagle/faqs/questions.html
Index: DB/fbsql.php =================================================================== RCS file: /repository/pear/DB/DB/fbsql.php,v retrieving revision 1.6 diff -u -r1.6 fbsql.php --- DB/fbsql.php 7 May 2003 16:58:28 -0000 1.6 +++ DB/fbsql.php 10 Jun 2003 18:16:51 -0000 @@ -205,29 +205,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result fbsql result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/ifx.php =================================================================== RCS file: /repository/pear/DB/DB/ifx.php,v retrieving revision 1.9 diff -u -r1.9 ifx.php --- DB/ifx.php 7 May 2003 16:58:28 -0000 1.9 +++ DB/ifx.php 10 Jun 2003 18:16:51 -0000 @@ -181,28 +181,6 @@ } // }}} - // {{{ fetchRow() - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result Informix result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** * Fetch a row and return as array. Index: DB/msql.php =================================================================== RCS file: /repository/pear/DB/DB/msql.php,v retrieving revision 1.6 diff -u -r1.6 msql.php --- DB/msql.php 7 May 2003 16:58:28 -0000 1.6 +++ DB/msql.php 10 Jun 2003 18:16:51 -0000 @@ -126,21 +126,6 @@ } // }}} - // {{{ fetchRow() - - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() function fetchInto($result, &$ar, $fetchmode, $rownum=null) Index: DB/mssql.php =================================================================== RCS file: /repository/pear/DB/DB/mssql.php,v retrieving revision 1.9 diff -u -r1.9 mssql.php --- DB/mssql.php 10 Jun 2003 16:26:10 -0000 1.9 +++ DB/mssql.php 10 Jun 2003 18:16:51 -0000 @@ -154,21 +154,6 @@ } // }}} - // {{{ &fetchRow() - - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() function fetchInto($result, &$ar, $fetchmode, $rownum=null) Index: DB/mysql.php =================================================================== RCS file: /repository/pear/DB/DB/mysql.php,v retrieving revision 1.15 diff -u -r1.15 mysql.php --- DB/mysql.php 7 May 2003 16:58:28 -0000 1.15 +++ DB/mysql.php 10 Jun 2003 18:16:52 -0000 @@ -251,29 +251,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result MySQL result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/mysql4.php =================================================================== RCS file: /repository/pear/DB/DB/mysql4.php,v retrieving revision 1.6 diff -u -r1.6 mysql4.php --- DB/mysql4.php 6 Jun 2003 18:58:33 -0000 1.6 +++ DB/mysql4.php 10 Jun 2003 18:16:52 -0000 @@ -251,29 +251,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result MySQL result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/oci8.php =================================================================== RCS file: /repository/pear/DB/DB/oci8.php,v retrieving revision 1.8 diff -u -r1.8 oci8.php --- DB/oci8.php 19 May 2003 20:45:31 -0000 1.8 +++ DB/oci8.php 10 Jun 2003 18:16:52 -0000 @@ -179,34 +179,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch a row and return as array. - * - * @param $result oci8 result identifier - * @param $fetchmode how the resulting array should be indexed - * - * @return int an array on success, a DB error code on failure, NULL - * if there is no more data - */ - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - if ($fetchmode & DB_FETCHMODE_ASSOC) { - $moredata = @OCIFetchInto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS); - } else { - $moredata = @OCIFetchInto($result, $row, OCI_RETURN_NULLS + OCI_RETURN_LOBS); - } - if (!$moredata) { - return NULL; - } - return $row; - } - - // }}} // {{{ fetchInto() /** Index: DB/odbc.php =================================================================== RCS file: /repository/pear/DB/DB/odbc.php,v retrieving revision 1.6 diff -u -r1.6 odbc.php --- DB/odbc.php 7 May 2003 16:58:28 -0000 1.6 +++ DB/odbc.php 10 Jun 2003 18:16:52 -0000 @@ -196,21 +196,6 @@ } // }}} - // {{{ fetchRow() - - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() function fetchInto($result, &$row, $fetchmode, $rownum=null) Index: DB/pgsql.php =================================================================== RCS file: /repository/pear/DB/DB/pgsql.php,v retrieving revision 1.22 diff -u -r1.22 pgsql.php --- DB/pgsql.php 7 May 2003 16:58:28 -0000 1.22 +++ DB/pgsql.php 10 Jun 2003 18:16:53 -0000 @@ -249,29 +249,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result PostgreSQL result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/sybase.php =================================================================== RCS file: /repository/pear/DB/DB/sybase.php,v retrieving revision 1.8 diff -u -r1.8 sybase.php --- DB/sybase.php 9 Jun 2003 16:52:40 -0000 1.8 +++ DB/sybase.php 10 Jun 2003 18:16:53 -0000 @@ -239,29 +239,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result Sybase result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /**
Index: DB/fbsql.php =================================================================== RCS file: /repository/pear/DB/DB/fbsql.php,v retrieving revision 1.6 diff -u -r1.6 fbsql.php --- DB/fbsql.php 7 May 2003 16:58:28 -0000 1.6 +++ DB/fbsql.php 10 Jun 2003 18:16:51 -0000 @@ -205,29 +205,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result fbsql result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/ifx.php =================================================================== RCS file: /repository/pear/DB/DB/ifx.php,v retrieving revision 1.9 diff -u -r1.9 ifx.php --- DB/ifx.php 7 May 2003 16:58:28 -0000 1.9 +++ DB/ifx.php 10 Jun 2003 18:16:51 -0000 @@ -181,28 +181,6 @@ } // }}} - // {{{ fetchRow() - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result Informix result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** * Fetch a row and return as array. Index: DB/msql.php =================================================================== RCS file: /repository/pear/DB/DB/msql.php,v retrieving revision 1.6 diff -u -r1.6 msql.php --- DB/msql.php 7 May 2003 16:58:28 -0000 1.6 +++ DB/msql.php 10 Jun 2003 18:16:51 -0000 @@ -126,21 +126,6 @@ } // }}} - // {{{ fetchRow() - - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() function fetchInto($result, &$ar, $fetchmode, $rownum=null) Index: DB/mssql.php =================================================================== RCS file: /repository/pear/DB/DB/mssql.php,v retrieving revision 1.9 diff -u -r1.9 mssql.php --- DB/mssql.php 10 Jun 2003 16:26:10 -0000 1.9 +++ DB/mssql.php 10 Jun 2003 18:16:51 -0000 @@ -154,21 +154,6 @@ } // }}} - // {{{ &fetchRow() - - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() function fetchInto($result, &$ar, $fetchmode, $rownum=null) Index: DB/mysql.php =================================================================== RCS file: /repository/pear/DB/DB/mysql.php,v retrieving revision 1.15 diff -u -r1.15 mysql.php --- DB/mysql.php 7 May 2003 16:58:28 -0000 1.15 +++ DB/mysql.php 10 Jun 2003 18:16:52 -0000 @@ -251,29 +251,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result MySQL result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/mysql4.php =================================================================== RCS file: /repository/pear/DB/DB/mysql4.php,v retrieving revision 1.6 diff -u -r1.6 mysql4.php --- DB/mysql4.php 6 Jun 2003 18:58:33 -0000 1.6 +++ DB/mysql4.php 10 Jun 2003 18:16:52 -0000 @@ -251,29 +251,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result MySQL result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/oci8.php =================================================================== RCS file: /repository/pear/DB/DB/oci8.php,v retrieving revision 1.8 diff -u -r1.8 oci8.php --- DB/oci8.php 19 May 2003 20:45:31 -0000 1.8 +++ DB/oci8.php 10 Jun 2003 18:16:52 -0000 @@ -179,34 +179,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch a row and return as array. - * - * @param $result oci8 result identifier - * @param $fetchmode how the resulting array should be indexed - * - * @return int an array on success, a DB error code on failure, NULL - * if there is no more data - */ - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - if ($fetchmode & DB_FETCHMODE_ASSOC) { - $moredata = @OCIFetchInto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS); - } else { - $moredata = @OCIFetchInto($result, $row, OCI_RETURN_NULLS + OCI_RETURN_LOBS); - } - if (!$moredata) { - return NULL; - } - return $row; - } - - // }}} // {{{ fetchInto() /** Index: DB/odbc.php =================================================================== RCS file: /repository/pear/DB/DB/odbc.php,v retrieving revision 1.6 diff -u -r1.6 odbc.php --- DB/odbc.php 7 May 2003 16:58:28 -0000 1.6 +++ DB/odbc.php 10 Jun 2003 18:16:52 -0000 @@ -196,21 +196,6 @@ } // }}} - // {{{ fetchRow() - - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() function fetchInto($result, &$row, $fetchmode, $rownum=null) Index: DB/pgsql.php =================================================================== RCS file: /repository/pear/DB/DB/pgsql.php,v retrieving revision 1.22 diff -u -r1.22 pgsql.php --- DB/pgsql.php 7 May 2003 16:58:28 -0000 1.22 +++ DB/pgsql.php 10 Jun 2003 18:16:53 -0000 @@ -249,29 +249,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result PostgreSQL result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /** Index: DB/sybase.php =================================================================== RCS file: /repository/pear/DB/DB/sybase.php,v retrieving revision 1.8 diff -u -r1.8 sybase.php --- DB/sybase.php 9 Jun 2003 16:52:40 -0000 1.8 +++ DB/sybase.php 10 Jun 2003 18:16:53 -0000 @@ -239,29 +239,6 @@ } // }}} - // {{{ fetchRow() - - /** - * Fetch and return a row of data (it uses fetchInto for that) - * @param $result Sybase result identifier - * @param $fetchmode format of fetched row array - * @param $rownum the absolute row number to fetch - * - * @return array a row of data, or false on error - */ - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } - $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); - if ($res !== DB_OK) { - return $res; - } - return $arr; - } - - // }}} // {{{ fetchInto() /**