php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: iakio at mono-space dot net
New email:
PHP Version: OS:

 

 [2004-11-23 21:22 UTC] iakio at mono-space dot net
Description:
------------
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';
 ?column?
----------
 A                                                                              (1 row)

ishida=# SELECT '\\101';
 ?column?
----------
 \101                                                                           (1 row)                                                                          
ishida=# SELECT cast('\\101' as bytea);
 bytea
-------
 A
(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);
$stmt->execute();


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'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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 pecl.php.net.

In case this was a pecl.php.net 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 Mar 28 17:01:29 2024 UTC