Skip to content

Commit 31962aa

Browse files
KentarouTakedadevnexen
authored andcommitted
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 phpGH-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 phpGH-21386 as not suitable for backport. close phpGH-21437
1 parent a2fc8fe commit 31962aa

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ PHP NEWS
7272
. Clear session-local state disconnect-equivalent processing.
7373
(KentarouTakeda)
7474

75+
- PGSQL:
76+
. Enabled 64 bits support for pg_lo_truncate()/pg_lo_tell()
77+
if the server supports it. (KentarouTakeda)
78+
7579
- Phar:
7680
. Support reference values in Phar::mungServer(). (ndossche)
7781
. Invalid values now throw in Phar::mungServer() instead of being silently

ext/pgsql/pgsql.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,15 +3083,11 @@ PHP_FUNCTION(pg_lo_tell)
30833083
pgsql = Z_PGSQL_LOB_P(pgsql_id);
30843084
CHECK_PGSQL_LOB(pgsql);
30853085

3086-
#ifdef VE_PG_LO64
30873086
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
30883087
offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
30893088
} else {
30903089
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
30913090
}
3092-
#else
3093-
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
3094-
#endif
30953091
RETURN_LONG(offset);
30963092
}
30973093
/* }}} */
@@ -3112,15 +3108,11 @@ PHP_FUNCTION(pg_lo_truncate)
31123108
pgsql = Z_PGSQL_LOB_P(pgsql_id);
31133109
CHECK_PGSQL_LOB(pgsql);
31143110

3115-
#ifdef VE_PG_LO64
31163111
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
31173112
result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size);
31183113
} else {
31193114
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
31203115
}
3121-
#else
3122-
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
3123-
#endif
31243116
if (!result) {
31253117
RETURN_TRUE;
31263118
} else {

0 commit comments

Comments
 (0)