From: Jouni Ahto Date: Tue, 23 May 2000 06:03:34 +0000 (+0000) Subject: According to current PostgreSQL docs, using PQoidStatus() is deprecated. X-Git-Tag: PRE_EIGHT_BYTE_ALLOC_PATCH~335 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c32de173c3b8e3eb878d1edcd2c8ec803ba1aee5;p=php According to current PostgreSQL docs, using PQoidStatus() is deprecated. --- diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index 3139eaa76a..d5a2f9e0ab 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -29,6 +29,7 @@ if test "$PHP_PGSQL" != "no"; then old_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR" AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[ ])) + AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[ ])) LIBS="$old_LIBS" LDFLAGS="$old_LDFLAGS" diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index e8f546768b..0a533c8a77 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1127,6 +1127,7 @@ PHP_FUNCTION(pg_getlastoid) RETURN_FALSE; } pgsql_result = pg_result->result; +#ifndef HAVE_PQOIDVALUE return_value->value.str.val = (char *) PQoidStatus(pgsql_result); if (return_value->value.str.val) { return_value->value.str.len = strlen(return_value->value.str.val); @@ -1134,7 +1135,15 @@ PHP_FUNCTION(pg_getlastoid) return_value->type = IS_STRING; } else { return_value->value.str.val = empty_string; - } + } +#else + return_value->value.lval = (int) PQoidValue(pgsql_result); + if (return_value->value.lval == InvalidOid) { + RETURN_FALSE; + } else { + return_value->type = IS_LONG; + } +#endif } /* }}} */ diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index f0ec320aed..559a0249fe 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -43,7 +43,8 @@ extern zend_module_entry pgsql_module_entry; #define pgsql_module_ptr &pgsql_module_entry #ifdef PHP_PGSQL_PRIVATE - +#undef SOCKET_SIZE_TYPE +#include #include #if (WIN32||WINNT)