According to current PostgreSQL docs, using PQoidStatus() is deprecated.

This commit is contained in:
Jouni Ahto 2000-05-23 06:03:34 +00:00
parent 78cec9f33e
commit c32de173c3
3 changed files with 13 additions and 2 deletions

View file

@ -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"

View file

@ -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);
@ -1135,6 +1136,14 @@ PHP_FUNCTION(pg_getlastoid)
} 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
}
/* }}} */

View file

@ -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 <postgres.h>
#include <libpq-fe.h>
#if (WIN32||WINNT)