PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #3659

Bugs pear-DB with mssql on FreeBSD-ports

Details

Submitted2005-03-01 10:53 UTC
Fromlecha at mambursoft dot org dot ua
Assigneddanielc
StatusNo Feedback
PackageDB
PHP Version5.0.3
OSFreeBSD 5.3
Roadmaps(Not assigned)

Comments

[2005-03-01 10:53 UTC] lecha at mambursoft dot org dot ua

Description:
------------
1. On connect.
< $dbhost .= $dsninfo['port'] ? ':' .
$dsninfo['port'] : '';
---
> $dbhost .= $dsninfo['port'] ? ',' .
$dsninfo['port'] : '';
Replace please "," to ":"

2. On Error.
Alert error without error!

Reproduce code:
---------------
1. On connect.
< $dbhost .= $dsninfo['port'] ? ':' . $dsninfo['port'] : '';
---
> $dbhost .= $dsninfo['port'] ? ',' . $dsninfo['port'] : '';
Replace please "," to ":"

2. On Error.
Alert error without error!

Fix /usr/local/share/pear/DB/mssql.php:
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
if (!@mssql_select_db($this->_db, $this->connection)) {
return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
}
$query = $this->modifyQuery($query);
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @mssql_query('BEGIN TRAN', $this->connection);
if (!$result) {
return $this->mssqlRaiseError();
}
}
$this->transaction_opcount++;
}
$result = @mssql_query($query, $this->connection);
// My edition !!!!!!!!!!!!!!!!
if ($this->errorNative()){
// if (!$result) {
return $this->mssqlRaiseError();
// }
}
// Determine which queries that should return data, and which
// should return an error code only.
return $ismanip ? DB_OK : $result;
}