Skip to content

Commit

Permalink
ext/pgsql: Add check for constant PGRES_TUPLES_CHUNK to fix compilati…
Browse files Browse the repository at this point in the history
…on failures

close GH-17540
  • Loading branch information
Christian Schneider authored and devnexen committed Jan 21, 2025
1 parent 0b12db6 commit fa21fce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ PHP NEWS
the cpu mask argument with entries type different than int/string.
(David Carlier)

- PgSql:
. Fixed build failure when the constant PGRES_TUPLES_CHUNK is not present
in the system. (chschneider)

- Phar:
. Fixed bug GH-17518 (offset overflow phar extractTo()). (nielsdos)

Expand Down
14 changes: 9 additions & 5 deletions ext/pgsql/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ if test "$PHP_PGSQL" != "no"; then
[Define to 1 if libpq has the 'PQsocketPoll' function (PostgreSQL 17 or
later).])],,
[$PGSQL_LIBS])
PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode],
[AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1],
[Define to 1 if libpq has the 'PQsetChunkedRowsMode' function (PostgreSQL
17 or later).])],,
[$PGSQL_LIBS])

old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $PGSQL_CFLAGS"

AC_CHECK_DECLS([PGRES_TUPLES_CHUNK],
PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode],
[AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1],
[Define to 1 if libpq has the 'PQsetChunkedRowsMode' function (PostgreSQL
17 or later).])],,
[$PGSQL_LIBS]),,
[#include <libpq-fe.h>]
)

dnl Available since PostgreSQL 12.
AC_CACHE_CHECK([if PGVerbosity enum has PQERRORS_SQLSTATE],
[php_cv_enum_pgverbosity_pqerrors_sqlstate],
Expand Down

0 comments on commit fa21fce

Please sign in to comment.