ID:               33813
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dseg at shield dot jp
-Status:           Open
+Status:           Assigned
 Bug Type:         Compile Failure
 Operating System: LINUX
 PHP Version:      5.1.0b3
-Assigned To:      
+Assigned To:      yohgaki


Previous Comments:
------------------------------------------------------------------------

[2005-07-22 04:57:48] dseg at shield dot jp

Patch for this bug:

--- ext/pgsql/config.m4.orig    2005-05-30 08:16:43.000000000 +0900
+++ ext/pgsql/config.m4 2005-07-22 09:33:47.000000000 +0900
@@ -88,6 +88,7 @@
   AC_CHECK_LIB(pq,
PQputCopyEnd,AC_DEFINE(HAVE_PQPUTCOPYEND,1,[PostgreSQL 7.4 or later]))
   AC_CHECK_LIB(pq,
PQgetCopyData,AC_DEFINE(HAVE_PQGETCOPYDATA,1,[PostgreSQL 7.4 or
later]))
   AC_CHECK_LIB(pq,
PQsetErrorVerbosity,AC_DEFINE(HAVE_PQSETERRORVERBOSITY,1,[PostgreSQL
7.4 or later]))
+  AC_CHECK_LIB(pq, PQfreemem,AC_DEFINE(HAVE_PQFREEMEM,1,[PostgreSQL
7.4 or later]))
   AC_CHECK_LIB(pq,
pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether
libpq is compiled with --enable-multibyte]))
   LIBS=$old_LIBS
   LDFLAGS=$old_LDFLAGS
--- ext/pgsql/pgsql.c.orig      2005-07-08 09:40:32.000000000 +0900
+++ ext/pgsql/pgsql.c   2005-07-21 13:21:52.000000000 +0900
@@ -3598,10 +3598,17 @@
 #if HAVE_PQUNESCAPEBYTEA
        tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len);
        to = estrndup(tmp, to_len);
-       PQfreemem(tmp);
 #else
        to = (char *)php_pgsql_unescape_bytea((unsigned char*)from,
&to_len);
 #endif
+        if(tmp) {
+#if HAVE_PQFREEMEM
+          PQfreemem(tmp);
+#else
+          efree(tmp);
+#endif
+       }
+   
        if (!to) {
                RETURN_FALSE;
        }

------------------------------------------------------------------------

[2005-07-22 04:28:04] dseg at shield dot jp

Description:
------------
PHP-5.1.0b3 won't build with PostgreSQL < 7.4.
The reason for this is that the ext/pgsql/pgsql.c use the PQfreemem
function which is only available in PostgreSQL 7.4 or later.

Reproduce code:
---------------
configure --with-pgsql

Expected result:
----------------
It should build

Actual result:
--------------
ext/pgsql/.libs/pgsql.o: In function `zif_pg_unescape_bytea':
ext/pgsql/.libs/pgsql.o(.text+0x3c2c): undefined reference to
`PQfreemem'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33813&edit=1

Reply via email to