Home » Database » MDB2_Driver_pgsql » Bug #8200
Error handling result of pg_set_client_encoding() in setCharset()
Details
| Submitted | 2006-07-13 08:34 UTC |
|---|---|
| From | meulen at aeteurope dot nl |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2_Driver_pgsql |
| PHP Version | 4.4.2 |
| OS | Windows 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 }