mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
According to current PostgreSQL docs, using PQoidStatus() is deprecated.
This commit is contained in:
parent
78cec9f33e
commit
c32de173c3
3 changed files with 13 additions and 2 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue