PEAR is archived and read-only

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

Home » Database » MDB2_Driver_pgsql » Bug #8200

Error handling result of pg_set_client_encoding() in setCharset()

Details

Submitted2006-07-13 08:34 UTC
Frommeulen at aeteurope dot nl
Assignedlsmith
StatusClosed
PackageMDB2_Driver_pgsql
PHP Version4.4.2
OSWindows 2000
Roadmaps(Not assigned)

Comments

[2006-07-13 08:34 UTC] meulen at aeteurope dot nl

Description:
------------
setCharset() in MDB2/Driver/pgsql.inc contains:

$result = @pg_set_client_encoding($connection, $charset);
if (!$result) {
return $this->raiseError(null, null, null, 'setCharset: Unable to set client charset: '.$charset);
}

pg_set_client_encoding() is documented to return 0 on success and -1 on error. In my tests it does.

IMO the result check should be:
if (0 != $result) { return error }