php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21248 first find PQescapeBytea then use it
Submitted: 2002-12-28 10:19 UTC Modified: 2003-01-10 22:01 UTC
From: phoemix at harmless dot hu Assigned: yohgaki (profile)
Status: Wont fix Package: PostgreSQL related
PHP Version: 4.3.0 OS: Linux2.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-12-28 10:19 UTC] phoemix at harmless dot hu
the postgresql module compiles for php, perfectly.
but PQescapeBytea and PQescapeString is not available on all system, I don't know why, it's libpq's fault.
php is linked dynamically with libpq, and PQescapeBytea is used by php. So apache cannot load the php module, due to an unresolved symbol(PQescapeBytea).
if PQescapeBytea doesn't available on a system php should use an own implementation.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-05 05:13 UTC] yohgaki@php.net
I would not like to add php own libpq function clone for following reasons.

 - Users are supposed to use libpq that matches backend
 - There is no use of pg_(un)escape_bytea function prior to 7.2
 - Users should be able to use addslashes() to escape strings. (Only a little inefficient and does not work for certain encodings. But these problematic encodings do not work with PHP anyway)

Extream case is PostgreSQL 7.3.x. It cannot even connect to older versions of backends. Use the libpq that comes from backend.
(Use the same major/minor version at least. You may use different patch level releases between client and backend)

Since bytea is almost useless without unescape function, I added pg_unescape_bytea() using locally implemented unescape bytea function for 7.2 users and it's available from 4.3.0.
(The unescape function is more efficient than original version, too :)
 

 [2003-01-05 06:01 UTC] phoemix at harmless dot hu
you missunderstood the problem.
i wasn't talking about php's own pg_* "interface", functions
i was talking about a symbol(excacly PQexcapeString) which php uses, as a shared library and also as a static library for apache, but on some hosts(I, Gergely Czuczy, don't know why) libpq is not containing this symbol. this means when you try to compile apache or load the php module you get an unresolved symbol. and this means you are unable to load the PHP, which means PHP is absolutely, surely unusable.
 [2003-01-10 22:00 UTC] yohgaki@php.net
If you are loading modules(shared objects in general) w/o required lib, it's normal to end up with undefined symbol.

Use RPM or like to make sure you don't have such problems.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC