| version 1.2, 2005/11/07 20:37:25 |
version 1.3, 2011/06/17 13:56:39 |
|
|
| * @package DB |
* @package DB |
| * @author Tomas V.V.Cox <cox@idecnet.com> |
* @author Tomas V.V.Cox <cox@idecnet.com> |
| * @author Daniel Convissor <danielc@php.net> |
* @author Daniel Convissor <danielc@php.net> |
| * @copyright 1997-2005 The PHP Group |
* @copyright 1997-2007 The PHP Group |
| * @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
| * @version CVS: $Id$ |
* @version CVS: $Id$ |
| * @link http://pear.php.net/package/DB |
* @link http://pear.php.net/package/DB |
| Line 46 require_once 'DB/common.php'; |
|
| Line 46 require_once 'DB/common.php'; |
|
| * @package DB |
* @package DB |
| * @author Tomas V.V.Cox <cox@idecnet.com> |
* @author Tomas V.V.Cox <cox@idecnet.com> |
| * @author Daniel Convissor <danielc@php.net> |
* @author Daniel Convissor <danielc@php.net> |
| * @copyright 1997-2005 The PHP Group |
* @copyright 1997-2007 The PHP Group |
| * @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
| * @version Release: 1.7.6 |
* @version Release: 1.7.14RC2 |
| * @link http://pear.php.net/package/DB |
* @link http://pear.php.net/package/DB |
| */ |
*/ |
| class DB_ifx extends DB_common |
class DB_ifx extends DB_common |
| Line 101 class DB_ifx extends DB_common |
|
| Line 101 class DB_ifx extends DB_common |
|
| '-236' => DB_ERROR_VALUE_COUNT_ON_ROW, |
'-236' => DB_ERROR_VALUE_COUNT_ON_ROW, |
| '-239' => DB_ERROR_CONSTRAINT, |
'-239' => DB_ERROR_CONSTRAINT, |
| '-253' => DB_ERROR_SYNTAX, |
'-253' => DB_ERROR_SYNTAX, |
| |
'-268' => DB_ERROR_CONSTRAINT, |
| '-292' => DB_ERROR_CONSTRAINT_NOT_NULL, |
'-292' => DB_ERROR_CONSTRAINT_NOT_NULL, |
| '-310' => DB_ERROR_ALREADY_EXISTS, |
'-310' => DB_ERROR_ALREADY_EXISTS, |
| '-316' => DB_ERROR_ALREADY_EXISTS, |
'-316' => DB_ERROR_ALREADY_EXISTS, |
| Line 113 class DB_ifx extends DB_common |
|
| Line 114 class DB_ifx extends DB_common |
|
| '-691' => DB_ERROR_CONSTRAINT, |
'-691' => DB_ERROR_CONSTRAINT, |
| '-692' => DB_ERROR_CONSTRAINT, |
'-692' => DB_ERROR_CONSTRAINT, |
| '-703' => DB_ERROR_CONSTRAINT_NOT_NULL, |
'-703' => DB_ERROR_CONSTRAINT_NOT_NULL, |
| |
'-1202' => DB_ERROR_DIVZERO, |
| '-1204' => DB_ERROR_INVALID_DATE, |
'-1204' => DB_ERROR_INVALID_DATE, |
| '-1205' => DB_ERROR_INVALID_DATE, |
'-1205' => DB_ERROR_INVALID_DATE, |
| '-1206' => DB_ERROR_INVALID_DATE, |
'-1206' => DB_ERROR_INVALID_DATE, |
| Line 243 class DB_ifx extends DB_common |
|
| Line 245 class DB_ifx extends DB_common |
|
| */ |
*/ |
| function simpleQuery($query) |
function simpleQuery($query) |
| { |
{ |
| $ismanip = DB::isManip($query); |
$ismanip = $this->_checkManip($query); |
| $this->last_query = $query; |
$this->last_query = $query; |
| $this->affected = null; |
$this->affected = null; |
| if (preg_match('/(SELECT)/i', $query)) { //TESTME: Use !DB::isManip()? |
if (preg_match('/(SELECT|EXECUTE)/i', $query)) { //TESTME: Use !DB::isManip()? |
| // the scroll is needed for fetching absolute row numbers |
// the scroll is needed for fetching absolute row numbers |
| // in a select query result |
// in a select query result |
| $result = @ifx_query($query, $this->connection, IFX_SCROLL); |
$result = @ifx_query($query, $this->connection, IFX_SCROLL); |
| Line 268 class DB_ifx extends DB_common |
|
| Line 270 class DB_ifx extends DB_common |
|
| $this->affected = @ifx_affected_rows($result); |
$this->affected = @ifx_affected_rows($result); |
| // Determine which queries should return data, and which |
// Determine which queries should return data, and which |
| // should return an error code only. |
// should return an error code only. |
| if (preg_match('/(SELECT)/i', $query)) { |
if (preg_match('/(SELECT|EXECUTE)/i', $query)) { |
| return $result; |
return $result; |
| } |
} |
| // XXX Testme: free results inside a transaction |
// XXX Testme: free results inside a transaction |
| Line 309 class DB_ifx extends DB_common |
|
| Line 311 class DB_ifx extends DB_common |
|
| */ |
*/ |
| function affectedRows() |
function affectedRows() |
| { |
{ |
| if (DB::isManip($this->last_query)) { |
if ($this->_last_query_manip) { |
| return $this->affected; |
return $this->affected; |
| } else { |
} else { |
| return 0; |
return 0; |
| Line 420 class DB_ifx extends DB_common |
|
| Line 422 class DB_ifx extends DB_common |
|
| */ |
*/ |
| function freeResult($result) |
function freeResult($result) |
| { |
{ |
| return @ifx_free_result($result); |
return is_resource($result) ? ifx_free_result($result) : false; |
| } |
} |
| |
|
| // }}} |
// }}} |
| Line 534 class DB_ifx extends DB_common |
|
| Line 536 class DB_ifx extends DB_common |
|
| */ |
*/ |
| function errorCode($nativecode) |
function errorCode($nativecode) |
| { |
{ |
| if (ereg('SQLCODE=(.*)]', $nativecode, $match)) { |
if (preg_match('/SQLCODE=(.*)]/', $nativecode, $match)) { |
| $code = $match[1]; |
$code = $match[1]; |
| if (isset($this->errorcode_map[$code])) { |
if (isset($this->errorcode_map[$code])) { |
| return $this->errorcode_map[$code]; |
return $this->errorcode_map[$code]; |