|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56236 8bit charactor escape problem(pod_pgsql)
Submitted: 2004-11-23 21:22 UTC Modified: 2005-01-17 05:39 UTC
From: iakio at mono-space dot net Assigned:
Status: Closed Package: PDO_PGSQL (PECL)
PHP Version: 5.0.0b1 (beta1) OS: Fedora Core 2
Private report: No CVE-ID: None
 [2004-11-23 21:22 UTC] iakio at mono-space dot net
In current cvs version pgsql_driver.c, (1.24 2004/09/23 21:15:51)
pod_pgsql can't treat 8bit charactors.

In this version, PQescapeBytea() is used for pgsql_handle_quoter().
But, PQescapeBytea() should be used for BYTEA data type,
and, pgsql_handle_quoter() should use PQescapeString().

BYTEA literal escaped representation is different from
TEXT literal escaped representation. for exsample,

ishida=# SELECT '\101';
 A                                                                              (1 row)

ishida=# SELECT '\\101';
 \101                                                                           (1 row)                                                                          
ishida=# SELECT cast('\\101' as bytea);
(1 row)

Release version seems good.

I can not explain well because I'm not good at English, Sorry.

Reproduce code:
$name = <<japanese euc-jp charactor>>;
$stmt = $dbh->prepare("select * from tbl where name = :name");
$stmt->bindParam(':name', $name);

Expected result:
sever log:
LOG:  statement: select * from tbl1 where name = <<japanese euc-jp charactor>>

Actual result:
sever log:
LOG:  statement: select * from tbl1 where name = '\\244\\242'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-16 06:04 UTC] iakio at mono-space dot net
change ``Package''.
 [2005-01-17 05:39 UTC] edink at emini dot dk
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 04:01:31 2024 UTC