From f308aee64535b0e2cd7778eecf40cf4dd8a52d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Sat, 14 Mar 2026 01:08:54 +0000 Subject: [PATCH] ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards The guards reference undefined VE_PG_LO64, a misspelling of HAVE_PG_LO64 (removed in GH-14628), making the 64-bit code paths permanently dead. Remove the guards to unconditionally enable the 64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek(). Dropped from GH-21386 as not suitable for backport. --- ext/pgsql/pgsql.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 80cade4d7605..f50bc680c4b9 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3083,15 +3083,11 @@ PHP_FUNCTION(pg_lo_tell) pgsql = Z_PGSQL_LOB_P(pgsql_id); CHECK_PGSQL_LOB(pgsql); -#ifdef VE_PG_LO64 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd); } else { offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); } -#else - offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd); -#endif RETURN_LONG(offset); } /* }}} */ @@ -3112,15 +3108,11 @@ PHP_FUNCTION(pg_lo_truncate) pgsql = Z_PGSQL_LOB_P(pgsql_id); CHECK_PGSQL_LOB(pgsql); -#ifdef VE_PG_LO64 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size); } else { result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); } -#else - result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size); -#endif if (!result) { RETURN_TRUE; } else {